WordPress.org

Forums

Page templates for categories - how to use "next_posts_link" to display earlier (2 posts)

  1. pwenglish
    Member
    Posted 3 years ago #

    I have page templates that use "query_posts" to select posts by category - I want to display for example 10 posts at a time. I have next_posts_link to go to earlier entries - but it doesn't work. It still displays the same 10 most recent entries. The same code on the default blog works fine.

    How to I make "older entries" actually display older entries in this situation?

    Grateful for any suggestions

    Paul

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    Try something like:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'News',
            'posts_per_page' => 10,
    	'paged' => $paged
    );
    query_posts($args);
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.