Home › Forums › All Other Themes › Charity Pro Latest News
- This topic has 5 replies, 3 voices, and was last updated 8 years, 6 months ago by Sonl Sinha.
-
AuthorPosts
-
May 5, 2016 at 2:10 am #32689
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.
May 5, 2016 at 6:55 am #32709Hi 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,
BradMay 7, 2016 at 11:03 pm #32950Hmm… 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' );
May 9, 2016 at 7:40 am #33018Kindly send us your WordPress admin details via sktthemes.net/contact we will fix it for you.
Regards,
ShriMay 30, 2016 at 8:15 pm #35451Thank you Shiri,
Once again your support is excellent. Everything is working great.May 31, 2016 at 6:07 am #35490Hi Brian,
If you found our service good kindly review us here: https://www.sktthemes.org/forums/topic/reviews-and-testimonials/
Regards,
Harris -
AuthorPosts
- You must be logged in to reply to this topic.