AFAIK, there is no way limiting the amount of paged queries with what is given by default. You might be able to make use of the filters provided to alter the SQL query.
You also do not want to use query_posts
at all and most probably you don’t even need a custom query. If this is the main query, you would want to make use of pre_get_posts
to alter the the query varaibles before the main query is executed. This way you won’t have problems paginating your queries
You can, however, limit the amount of pages shown with next_posts_link
. You can simply just set the amount of pages you need.
Example:
next_posts_link( 'Older Entries',10 );
Related Posts:
- WP-PageNavi gives me a 404 when using WP Query
- Page navigation doesn’t show when query category
- How do I sort posts with multiple pages
- How can i show pagenavi in my author.php?
- Pagination in custom query in a category page
- Pagenavi with archive page
- order by numeric value for meta value
- numberposts? showposts? posts_per_page?
- $GLOBALS[‘wp_the_query’] vs global $wp_query
- Some doubts about how the main query and the custom query works in this custom theme?
- How to query posts based on lat-lng coordinate as post meta?
- How to query only for products with status “in stock” in WooCommerce? [closed]
- WP_Query displaying ALL posts
- Does WordPress sanitize arguments to WP_Query?
- How to trigger 404 for custom query var?
- Highlighting Sub topic in a post?
- How to combine tax_query and date_query in WordPress
- How to get any tag ID
- WP_Query with many meta_query arguments taking a long time to load
- wp_query display posts from same category of the post
- Targeting specific pages in the loop
- WordPress custom archive page
- Order posts by meta value and Date
- Include Sticky Posts in Page Post Count for custom query
- Query sticky posts with thumbnails
- Show all parents and children in custom post type in right order
- Why is this coming back as null? Thats wrong. There is one post
- Retrieve featured image (thumbnail) url from multiple posts with one query
- How to implement time filter to show random post 1 month for one category and 3 months for other categories
- Can you order posts from wp_query by two custom meta fields?
- Retreaving all images attached to current post
- wp_query() get_col error
- Pagination working everywhere but the index page
- How to select posts from one category but exclude posts in another category?
- How do I search inside specific taxonomies in WordPress
- Order a query result by a numeric meta key even if it does not exist, but put the posts with meta key first
- How can you get first post, last post and post count in a category?
- What’s the purpose / logic of split_the_query in WP_Query->get_posts
- WP_query posts closest to todays date
- if statement in wp_query arguments
- Need wp_query to return all children and grandchildren
- How to use offset in WP_Query
- difference between like ‘%%%var%%’ and ‘%var%’
- WP Query Category Atribute Not Working
- How to build a WP_Query using mulitple tags and using AND or OR operator between them
- new WP_Query to get max price meta value not working
- wp_query should show stickies first
- WordPress custom post type with meta – how to retrieve with wp_query
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- Order by meta value (numeric value lower to higher)
- WP_Query with different postmeta filter for each categories
- Wp query show post by author name or post title or post content
- wordpress ajax relationship query
- Admin Page Post Id wp_reset_postdata not working
- Multiple queries and performance – wp_query
- WP_Query for a taxonomy with different taxonomy types
- Display single most recent post in category on every page of category archive
- Executing query_posts after wp_insert_post
- Redirect Search to Form When No Product Results Are Found
- Show menus to one admin username
- inserting content of 1 Post to in another with a template hierarchy
- get_posts custom field
- wp_query posts with custom fields number smaller than
- Get the child category ID of current category
- Related Posts Excluding Certain Categories
- Unlimited Page Sitemap Link
- Limit number of posts in WP_query per month
- Custom query does not find pages
- Custom taxonomy in WP_Query not working
- Add category to my get_post query
- Display posts ONLY from the current logged in user and current week/year/month Elementor posts
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- How to use custom page for all posts with custom url, call another directory?
- Pagination repeating posts on search results
- Change normal grids to masonry grids
- order posts by a secondary query that counts items
- How to use wp query in my custom page without including header and footer in wordpress
- WP_Query, ACF field and array
- cron job for custom post type not working since WordPress 5
- WP_Query – multiple orderby with a rand field, doesn’t work
- query not working for ordering by meta_key
- Insert wp_query after the_content with plugin (filter the_content won’t work)
- WordPress pagination not returning posts on second page
- Query 3 meta_key and orderby
- How can I use a specific wordpress page template if certain words are used in page title [closed]
- wp-query with a tax-query relation of NOT
- Custom query using WP_Query is not working
- Calling body_class and wp_nav_menu for a different post
- Category Archive not working for pages
- Custom query on custom table fails
- Get closest event where meta_key field is an array
- Can’t get the_content to show
- Get a list of the last posts grouped by author and filtered by category
- Sort by name – second wp_query
- How to query post ids liked by the Author
- Meta_query weird behaviour
- Modify query after meta value
- How to replecate the _fields parameter in custom REST api endpoint
- How do I have multiple metaqueries inside one wordpress query
- Can I use WP_Query to find a post with a particular menu_order?