WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How can I create a "Next Page" link in category.php? (3 posts)

  1. iwriteblogs
    Member
    Posted 2 years ago #

    If you use the below code in category.php you will see the titles of your most recent posts in that category. In my Reading Settings I set the posts per page to 3. There are 5 posts in my category, and I can confirm only 3 are shown now, but I do not see any link to get the next page with the rest of the posts in this category. I figured there must be some other tag required, but I cannot find it. I've read the tutorials in the Codex (that's how I built the rest of my file) and I also tried to reverse-engineer some category.php pages from other themes I've downloaded, but I can't find what I need.

    <?php while ( have_posts() ) : the_post(); ?>
    <?php the_title('<h3>', '</h3>'); ?>
    <?php endwhile; ?>

    Would someone please point me in the right direction to make "Next page" and "Previous page" links on my category pages? Thank you!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    http://codex.wordpress.org/Function_Reference/next_post_link
    http://codex.wordpress.org/Function_Reference/previous_posts_link

    example code:

    <div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
  3. iwriteblogs
    Member
    Posted 2 years ago #

    Thank you so much! :)

Topic Closed

This topic has been closed to new replies.

About this Topic