I modify such that it can show five more post of the same category of the original post ... This is the code I added in single.phpSo now that single.php post will print Original post ( which is suppose to be there on that post page by default ) 1st post from the same cat 2nd post from the same cat 3rd post from the same cat So now come the comment part. I expected it to display the comment done to the the original post ..... but the problem is that it always show the comment done to the last post display over there which is the 3rd post here in my example.. No matter which ever post I view of that category it will shows the comment of the last post displayed over there.. How I can fix this ? Solution - Remove any added code from single.php .$category = get_the_category(); $args = array( 'numberposts' => 3,'offset'=> 1, 'category' => $category[0]->cat_ID ); $lastposts = get_posts( $args ); foreach($lastposts as $post) : setup_postdata($post); ?> <?php endforeach; ?>
If you like this post then please post/share your comment below.
Thanks, Admin, majhiaai.com@gmail.com
No comments:
Post a Comment