• Hey there.

    For some reason, my category page for a certain category is only displaying one post made in that category – the latest one. Even though I know there are 2 or 3 (WordPress Dashboard shows the stats for each category)

    Try it out yourself.
    http://fidotraining.com

    The top bar are the categories, “Training” and “The Basics” have 2 or 3 articles each, yet only one shows up. Here’s my code.

    <?php get_header(); ?>
    
    <?php if (have_posts()) : ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    <div class="post-container">
    	<div class="post-header">
    		<div class="post-avatar"></div>
    		<div class="post-title">
    			<?php the_title(); ?>
    		</div>
    		<div class="post-meta">
    			Category: <?php the_category(', ') ?>.  Tags: <?php the_tags(__(''), ', ', ''); ?>.  <?php edit_post_link('Edit', ''); ?>
    		</div>
    		<div class="clear"></div>
    	</div>
    	<div class="post-content">
    		<?php the_excerpt(); ?>
    		<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read More...</a></p>
    	</div>
    	<div class="clear"></div>
    </div>
    <div style="height:15px;width:100%;padding:0px;border-bottom:1px dashed #ccc;margin:0px 0px 15px 0px;"></div>
    
    <?php endwhile; ?>
    
    <?php else : ?>
    
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    
    <?php endif; ?>
    
     </div>
     <!--/content -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Help appreciated alot!
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You should be able to set this in your dashboard.

    Go to Settings > Reading > Blog pages show at most and set that number.

    Thread Starter ralph23

    (@ralph23)

    Oh man that’s right, I set that to one. Thanks.

    I did that because I want the index.php to only display my first post (I have post going in reverse chronological order)

    Hmm… I guess I have to change the 1 to something else. But how can I keep my index.php showing only one blog post? Or even, how can I get it to show one specific blog post? (It’s my welcome post)

    Copy whatever code you have now onto the index.php and the setup above to display multiple post onto single.php

    You can use query_posts to only display one post on your home page.
    http://codex.wordpress.org/Template_Tags/query_posts

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Category Page Only Displaying Latest Post Made In That Category’ is closed to new replies.