As Eugene pointed out, you omitted the paged
variable. However, even with that in you can get unexpected behaviour. As illustrated by the various questions we get on query_posts
and pagination:
Related Posts:
- grab neighboring content in a query
- Pagination on archive.php page
- Having trouble generating pagination links on custom query
- query_posts and pagination, still stuck after much research
- how could I get the pagination as I want to when query posts using get_posts function
- pagination in author.php template returns 404 error
- How do i paginate query_posts with numeric pagination?
- How to make my pagination loop continuously?
- Pagination on custom query
- Custom posts per page does not work with pagination
- WordPress pagination showing same posts on each page
- next_post_link for CPT only working for a few posts? weird!
- WordPress pagination with get_posts?
- Using ajax with paging and a custom sub-query
- Why do next pages load the same content rather then older articles?
- Next and Previous Posts of Same Parent
- Custom loops, sticky posts, and pagination nightmare
- Querying posts only if the current page is not paged?
- Displaying the author of next and previous posts in pagination?
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- Can’t get pagination to work for sticky posts only
- How do I use pagination in WordPress?
- WordPress post pagination continuous [duplicate]
- Pagination linking to first page
- WP_Query and pagination AGAIN?
- pagination links not displaying
- Modify main loop query for paged and meta key
- WordPress not showing pagination links
- Need help with get_posts pagination
- previous_posts_link returns null when querying custom post type
- Post Filter clearing on pagination $_post
- get_next_posts_link() stops displaying at page 4
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- pagination/prev and next page links not showing
- Achieving pagination with `query_posts`
- how to query posts by category and tag?
- How do I query by post format in WordPress 3.1
- Get Previous & Next posts by Post ID
- get_query_var(‘paged’) always returns empty
- How to set posts per page using WP_Query()
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- Custom Post Type “Event”: chronological list of recurring events
- Order by meta value, pro first, then free
- How to create an attachments archive with working pagination?
- Counter code for paginated category pages in wordpress
- Author List page: Exclude based on last post date
- Replace query_posts with pre_get_posts
- query_posts sort in multiple directions
- Filter query_posts by tag slug on “Tag Archive” page (when tag is 2 or more words)
- WordPress previous_post_link exclude posts with multiple categories
- Warning: urlencode() expects parameter 1 to be string, array given in and not getting the preffered output
- Using database meta_values to calculate new post order using pre_get_posts or a ‘request’ hook
- exclude ids through post__not_in
- Next and Previous links on a single taxonomy page only link to same term
- connect last post with first post
- Integrating post archive wtih another source and preserving date ordering
- “next_posts_link” and “previous_posts_link” display me NOTHING
- Order posts using a custom array
- Can I use get_adjacent_post for specific categories?
- Add #anchor to next/previous_post_link
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Show Only Posts Owned By Logged In User + my post
- Custom MySQL Query with logic
- order posts by meta value on posts page
- trouble with query to fetch next and previous posts
- Simple custom post query for all the posts or many of them not working
- Hook to return true when the_post() is used in a custom while loop
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- get_next_post_link() and get_previous_post_link() return wrong posts
- Proper syntax to add boolean in array()
- using query_posts to pull posts out of a category in a while loop. Getting odd echo
- Echo a numerical value in query_posts
- why to use query_posts() in custom page?
- next_post_link / previous_post_link not working with WP_Query
- Query posts to get all but the most recent post
- Always using the same ARRAY on different querys
- Single.php Category Post Count
- Modify loop but keep the original query, what am I doing wrong?
- Post per page not working if no category specified
- Get previous/next post from (specific) category
- How exclude 3 latest posts of a category in query_posts
- filter posts by meta key with pagination
- Weird problem on if statement
- Issue with sidebar widgets not showing when I do custom queries
- Why would post_type be ignored in this query?
- query_posts call sets is_home() to true
- Ajax (jquery) wp_query pagination returns -1
- Script that gets the first tag of post and query all other posts with the same tag
- Trouble highlighting correct menu parent with wp_nav_menu classes while viewing “single posts”
- Latest 5 post excerpts from 5 different authors in Sidebar
- How to get next post link of child custom post type from parent post and get next post link of parent post from the last child post?
- Help with query_posts function
- Why next_posts(); function does not work inside header.php?
- Using previous_post_link next_post_link but with a filter on a custom field
- Conditionally (cpt) filter previous and next_post_link
- Including post data in a sidebar occurring outside of and before the Loop
- Retrieving next_post_link() and previous_post_link() in functions.php
- how to implement next/prev within category archive?
- Next/previous post link to posts only within one or more specific categories
- How to add thumbnail support to WordPress next / previous post loop?