• Resolved TonyaOD

    (@tonyaod)


    I have created a blog. The Category is blog. I have successfully created a blog.php template bag that has the loop in it that shows my posts.

    I want it to show a specific number of posts per page. So if I end up with 22 posts and show 10 per page I will have 3 pages with navigation at the bottom that scrolls through the pages. So far I have added 6 posts to test & asked it to show 2 per page – this works.

    I have added navigation but when I click the links I simply get my single.php page with the previous or next single post on not the page showing the previous 2 posts. Does that make sense. Can anyone point me to an article or web help or simply help me with this problem?

    Here is the code

    <?php if (query_posts('cat=blog&showposts=2'.'&paged='.$paged)) : ?>
        <?php $count = 0; ?>
     <h2>Here are a few of our recent posts:</h2>
    
    <?php while (have_posts()) : the_post(); ?>
        <?php $count++; ?>
        <!-- increase post count by 1-->
        <h3><a href="<?php the_permalink() ?>">Title: <?php the_title(); ?></a></h3>
        <p>Date: <?php echo date("l, F d, Y"); ?> 
    
    		<?php the_content(); ?> 
    
    	<?php endwhile; ?>
    	<h4><?php previous_post_link('%link', 'Older Blog Posts', TRUE); ?> ||
    	<?php next_post_link('%link', 'Newer Blog Posts', TRUE); ?></h4>
    
    <?php else : ?>
    	 <p>There are no posts to display</p>
    <?php endif; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Help my navigation is not paging as expected’ is closed to new replies.