get_query_var('paged') doesn't seem to work on page templates
I’m have my site set to display a page instead of recent posts as the front page of my blog. That page is using a template I’ve created to show all posts that are in the category of the most recent post.
This is all fine and good until I need to use pagination, which doesn’t seem to work on ‘pages’
I’m using the method of:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=$recent&paged=$paged");
But this isn’t working. To test, I simply echo get_query_var(‘paged’) and all I get is an empty string.
I know this is an issue specifically with page templates because if I copy my exact code to the index.php file, it works fine.
Is there something that prevents pagination on pages? Is there another way I can get the current page without using get_query_var(‘paged’)?
- The topic ‘get_query_var('paged') doesn't seem to work on page templates’ is closed to new replies.