Pagination question
-
The code below shows 15 permalinks in a list from category ‘film’. Since I have 20 permalinks, 5 will be shown on page 2 (paged=2).
My problem is: when I use (click/press) a permalink on page 2 the respective post opens, but my permalink-list now shows page 1 instead of page 2.
I know it have something to do with the default variable ‘1’ in the code below, but how to solve this?
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("category_name=film&posts_per_page=15&paged=$paged"); ?> <ul style="list-style:none;"> <?php while(have_posts()) : the_post(); ?> <li> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> </li> <?php endwhile; ?> <p><?php wp_pagenavi(); ?></p> </ul>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Pagination question’ is closed to new replies.