Page Navigation
-
Hi
I have 2 blog pages within a mainly CMS wordpress site. I have a template file called news that both these blog pages use. The file looks at what page it is and retrieves the post within the relevant category (so 2 categories and 2 pages). I also have archives links at the top of the page, again filtered by categories. This all works fine.
The problem is I wanted to only show the latest 5 posts (within the relevant category) and then have navigation at the bottom for the next 5 posts ect..
When I click next page or previous entries, it just reloads the same page with the same posts. I did notice that the url gets /page/2 added though?!
Below is what I have so far…
Any help is hugely appreciated! ! !
[Code moderated as per the Forum Rules. Please use the pastebin]
-
Uh, I’m confused.
Plugin: wp-pagenavi (Demo: http://lesterchan.net/wordpress/)
WP Settings: Limit posts to 5you probably have used a custom query without the paged parameter:
http://codex.ww.wp.xz.cn/Function_Reference/query_posts#Pagination_Parametersexample with paged parameter:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; // pagination $args = array( 'posts_per_page' => 9, // optional to overwrite the dashboard setting 'paged' => $paged, 'cat' => 0, 'orderby' => 'date', 'order' => ASC ); query_posts($args);alchymyth, you’re spot on, I have implemented your suggestion and it works perfectly! I’m now off to to read the function ref to make sense of it 🙂
Thanks very much!!!
Arron
The topic ‘Page Navigation’ is closed to new replies.