Modified Category Page Now Only Shows 1 Post
-
I have modified a category page in multiple ways, one step at a time, and all worked until I modified it so that when there are NO posts it will show a placeholder graphic.
-When there is NO post, the placeholder graphic shows (as is desired).
-When there is a post, the placeholder graphic does not show, and the post does (as is desired).The problem is, if there is more than one post, the page will still only return one post.
<?php get_header(); ?> <div id="content"> <?php the_post(); ?> <?php rewind_posts(); ?> <?php if ( have_posts() ) : the_post();?> <div id="complete_entry"> <div id="td1_replace"> <a href="<?php the_permalink(); ?>" target="_top" title="<?php the_title();?>"> <?php if ( has_post_thumbnail() ) { $thumbnail_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' ); echo '<div id="thumbnail_background" style="background-image:url(' . $thumbnail_url[0] . ');">'; } ?> <img src="/adopt/wp-content/themes/chibitude2014/images/purple_frame.png" id="frame_overlay"> </a> </div> <!--end td1_replace--> <div id="td2_replace"> <a href="<?php the_permalink(); ?>" target="_top" title="<?php the_title();?>"> <?php the_title();?></a> <?php get_template_part ('entry','summary');?> <?php $args = array( 'number' => 1, 'post_id' => $post->ID, 'status' => 'approve' ); $latest_comment = get_comments( $args ); if( $latest_comment ) foreach( $latest_comment as $comment ) { /*whatever you want to show from the comment, for instance*/ ?> High Bid:<?php echo $comment->comment_content; ?> <?php } ?> </div> <!--end "td2_replace"--> </div> <!--end "complete_entry"--> <?php else : echo ""; ?> <div id="empty" style="margin:25px auto;text-align:center;"><img src="../2014/~images/2015ChunkUnavailable.png"></div> <?php endif; ?> </div> <!--end "content"--> <div id="pagination"> <?php wp_pagination(); ?> </div> <?php get_footer(); ?>
Here is the page in question:
https://chibitude.com/adopt/?cat=248
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Modified Category Page Now Only Shows 1 Post’ is closed to new replies.