If you’re creating your own custom WP_Query
queries, you can use the posts_per_page
parameter:
$args = array(
// ...
'posts_per_page' => $some_number,
//...
);
$my_query = new WP_Query( $args );
If you want all the posts, use -1
as your $some_number
.
Reference
Related Posts:
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- Using get_posts vs. WP_Query
- Way to include posts both with & without certain meta_key in args for wp_query?
- How to Access Global $multipage or Global $numpages outside the loop?
- How can I use WP-CLI commands without –allow-root
- Merging a complex query with post_rewind and splitting posts into two columns
- WP_Query in a shortcode
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- meta_query not working properly
- Get all posts without tags
- Filter wp_query to search post title in function
- Two queries on the same page with pagination
- Using tax_query reverses my post_type argument in a custom WP_Query
- Best approach to create Hot and Trending sections
- creating wp query with posts with specific category
- $wp_query->current_post restarts from zero on paged pages
- get complex results set according to category structure
- Setup of taxonomy term template pages
- Ignore post by meta value in the main query
- Display posts in 3 days chunk
- how to get the id for a post from within a post and return post meta for it
- WP_Query’s “request” SQL Query
- How to do a query on custom taxonomies that is uncategorised?
- How to make this WP_Query run faster on a WordPress website?
- Order taxonomy terms in alphabetical order
- is_search was called incorrectly
- Empty tax_query array returns an empty array
- How do I sort posts with multiple pages
- Sorting By Custom Posts With Attachments
- How to choose between hooking into per_get_posts or into parse_query
- How to set pagination to work with ‘/page/’?
- How to do meta_query for attachments?
- How can I fix: “Notice: Undefined offset: 0”?
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Most commented last 24h, week, month, year and all time – posts_where
- WP_Query Pagination on multiple-loop page breaks WP or doesn’t show up
- category query for pages not working
- Bypass “supress_filters” in WP Query
- date_query on draft posts only
- Order ascending is ignored in meta query?
- Custom Pagination in Shortcode with WP_Query
- How to get list of posts from permalinks?
- WP Query – Post Thumbnail
- How to change main query to only query posts from a single category? [duplicate]
- Pagination for blog posts reloading same page [closed]
- wp_query not working with post_type
- Individual months in WP Query
- how to use pre_gets_posts to exclude one queried ID from homepage loop
- date_query in pre_get_posts out of memory
- Combine 2 WP_queries into one (OR relation)
- WP_QUERY wrong ammount of posts
- How to add sort order to incremented and paginated category loop
- One WP_Query that always shows 1 post from category X and 1 post from “not in category X”?
- Link Author URL’s based on a custom field
- How to set parameters for search loop?
- Get posts with no tags?
- get_posts query matches too many results
- Sort by custom field that is an array?
- Which is from this queries is more faster
- Start Query from 2nd Post without offset
- Related posts by current posts child category
- Trying to change category of wp_query
- Any quicker alternative for WP_Query “NOT IN”
- Tax Query on product_cat using NOT IN as operator does not exclude that category
- duplicated posts when using pagination
- How to use the Term Object from a custom select field in a query
- Random users always showing same 8 users
- meta_query order by date present -> future then show null
- Wp-query and column blocks
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- How to query for exact string in custom field?
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Sort posts on custom field AND after that sort on date?
- Get last child of given page by ID
- How to query users by post count no less than 10
- display the children of the post using the current page as the main parent
- Display 3 levels of categories on page
- Paginated Author.php not using Author.php template
- Help displaying related categories
- A very strange problem with search query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Custom Theme Building & Permalinks
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- The sorting of posts by a meta_query with two keys fails while separated as single queries it works
- Display First posts without the default featured image
- Hierarchical List Pages as a table
- WP_Query with several meta_query-statements and order by meta_value
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- query_posts, oderby meta_value & print “future” posts
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts
- wp_query loop with compare operator simply not working, why?
- Query All Posts: Either Display Most Recent or One with Particular ACF Value Chosen
- Display only posts with thumbnails