Page and next_posts_link – Doesn’t work properly
-
I’m puzzled. Idea is that I have different categories of posts and there is a page created for each category. Each page should show one post from its designated category.
I use the following on the created page.
<?php //The Query query_posts('posts_per_page=1&cat=4'); //The Loop ?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> ... <?php endwhile; ?> <?php next_posts_link('« Older') ?> <?php previous_posts_link('Newer »') ?> <?php else : ?> ... <?php endif; ?> <?php //Reset Query wp_reset_query(); ?>
It shows properly the first post from category, but then when I click “Older”-link, it displays the same first post again even if the address changes correctly to /wordpress/pagename/page/2 etc.
Anyone have thoughs of what I’m doing wrong? Is there better way of doing this what I am trying to get done?
And another question related to the previous one. Is there a code that I could use to echo the available $is_* variables? I mean, in a way like echoing all different “environmental variables” from a given page for debugging purposes.
- The topic ‘Page and next_posts_link – Doesn’t work properly’ is closed to new replies.