Charity Pro Latest News

Home Forums All Other Themes Charity Pro Latest News

This topic contains 5 replies, has 3 voices, and was last updated by  Forum Moderator 2 years, 1 month ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32689

    Brian Dimitroff
    Member
    • Topics: 3
    • Replies: 3
    • Total: 6
    Member since: April 10, 2015

    There seems to be an issue with the Latest News section where the width of each post is showing up as a percentage of the width of the post above it rather than a percentage of the width of the parent container. The posts are also not appearing side by side like they do on the demo page, but instead they’re all stacked on the left. You can see what I’m talking about at http://test.justiceforhumanity.com

    I tried looking at the shortcode in custom-functions.php, but I’m not experienced enough to troubleshoot the issue. Could you please help identify what needs to be fixed? Thank you.

    #32709

    Forum Moderator
    Member
    • Topics: 0
    • Replies: 17127
    • Total: 17127
    Member since: August 16, 2013

    Hi Brian,

    Kindly go to custom-function.php and find this code

    '.content(25).'

    And replace it with this code

    '.wp_trim_words( get_the_content(), 20, '' ).'

    Regards,
    Brad

    #32950

    Brian Dimitroff
    Member
    • Topics: 3
    • Replies: 3
    • Total: 6
    Member since: April 10, 2015

    Hmm… I successfully made the change but it didn’t fix it. Any other ideas? When I take a look at the page source in a browser, it looks like the problem is that the <div class=”news-box”> container isn’t getting closed with a </div> after each post. Instead, each new post is getting inserted into the <div class=news-box> element of the post before it, and all the closing tags are just being stacked at the end of the section.

    Here’s the latestposts code from my custom-functions.php file:

    function latestpostsoutput_func( $atts ){
       extract( shortcode_atts( array(
    		'show' => '',
    	), $atts ) );
    	$postoutput = '';
    	wp_reset_query();
    	$n = 0;
    	query_posts(  array( 'posts_per_page'=>$show, 'post__not_in' => get_option('sticky_posts') )  );
    	if ( have_posts() ) :
    		while ( have_posts() ) : the_post();
    			$n++;
    			if( $n%2==0 )  $nomgn = 'last';	else $nomgn = ' ';
    			if ( has_post_thumbnail()) {
    				$large_imgSrc = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
    				$imgUrl = $large_imgSrc[0];
    			}else{
    				$imgUrl = get_template_directory_uri().'/images/img_404.png';
    			}
    			$postoutput .= '<div class="news-box '.$nomgn.'">
    								<div class="news-thumb">
    									<a href="'.get_the_permalink().'"><img src="'.$imgUrl.'" alt=" " /></a>
    								</div>
    								<div class="news">
    									<div class="date-news">
    										<span class="newsdate">'.get_the_time('d').'</span>
    										<span>'.get_the_time('M').'</span>
    									</div>
    									<a href="'.get_permalink().'"><h4>'.get_the_title().'</h4></a>
    									 '.wp_trim_words( get_the_content(), 20, '' ).' 
    								</div>
                            </div>';	
    						$postoutput .= ''.(($n%2==0) ? '<div class="clear"></div>' : '');	
    		endwhile;
    	endif;
    	wp_reset_query();
    	return $postoutput;
    }
    add_shortcode( 'latestposts', 'latestpostsoutput_func' );
    
    #33018

    SKT Themes
    Keymaster
    • Topics: 2
    • Replies: 6266
    • Total: 6268
    Member since: June 12, 2013

    Kindly send us your WordPress admin details via sktthemes.net/contact we will fix it for you.

    Regards,
    Shri

    #35451

    Brian Dimitroff
    Member
    • Topics: 3
    • Replies: 3
    • Total: 6
    Member since: April 10, 2015

    Thank you Shiri,
    Once again your support is excellent. Everything is working great.

    #35490

    Forum Moderator
    Member
    • Topics: 0
    • Replies: 17127
    • Total: 17127
    Member since: August 16, 2013

    Hi Brian,

    If you found our service good kindly review us here: https://www.sktthemes.net/forums/topic/reviews-and-testimonials/

    Regards,
    Harris

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.