Maybe a very quick and (simplified)dirty way I show here, but would this function not solve it without the need to make changes for/in the templates?
(Yes I know I also make queries in my templates but wanted to help out before leaving office)
function wpse214084_max_post_queries( $query ) {
if(is_tax('genre')){ // change genre into your taxonomy or leave out for all
// show 20 posts
$query->set('posts_per_page', 20);
}
}
add_action( 'pre_get_posts', 'wpse214084_max_post_queries' );
FYI: Maybe you take a look at
pre_get_posts
in
the codex and also at
is_tax
.
What you probably where/am looking for is query
posts
post_per_page.
I hope this helps you out or at least gives some guidelines.
Related Posts:
- Get taxonomy terms only of the WP_Query current posts
- How to find objects by terms
- How do I get taxonomy terms by ID in a specific order
- WP_Query use for a filter with multiple Taxonomies and Terms
- Display Post co-authored in Author Page
- Custom page archive query by url var calling page twice on one of my custom queries?
- Get term siblings of current child taxonomy
- How to get post’s current parent term ID?
- List taxonomy term slugs within shortcode (do_shortcode)
- Copy taxonomy terms from one post to another programmatically
- Hide image if taxonomy term is empty
- Isotope Drop Down Categories Filter Function
- How to filter custom taxonomy term name, slug, and description?
- Hierarchical taxonomy list with modificated term links
- Exclude product attributes from taxonomy terms loop
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- Trying to display terms from custom taxonomy within function
- How do I edit the terms output args or array data?
- update_term_meta() only updating once on certain meta keys
- Search for single post by 2 tags
- WordPress search query, how to modify the sql
- New term taxonomy and description in front page. Input’s
- How to display terms from two taxonomies in one php code?
- Get all the contents of taxonomy and sort by term
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Three different queries on same page
- WordPress taxonomy and terms question
- Best Practice for PHP
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- I want to remove the links from the term list returned by get_the_term_list
- Get all taxonomies for all post types
- if statement on database query
- How to add terms to my tax_query based off of the current post
- WP_Query meta_query results date by date
- Help with adding pagination to custom wp_query
- API response to be stored locally
- get_terms orderby numeric
- How to filter posts by post format “standard” from wp-json api?
- Create a hierarchical taxonomy list in WordPress
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Get authors by term id or slug
- Loading the same WP_Query in two different wordpress .php templates
- How to prevent WP_Query function from returning all posts when empty?
- How to get original custom taxonomy slug after the slug has been rewritten?
- How to store post ID’s in cookie or session to display the same posts later
- register_taxonomy() take much queries
- Way to bulk make all my tags lowercase?
- Taxonomy order exception for specific term
- Create a Blog Template Page
- Exclude posts with specific metadata from search?
- Display an image if odd number of posts in grid
- Get posts from multiple tax terms
- Why doesn’t PhotoSmash plugin play well with wp_query?
- How to show meta value code HTML after x paragraph
- Form search query – displaying ACF “Post Object” field as results
- get_the_ID() doesnt work
- change the default order of posts only for specific categories
- Custom post type permalinks do not appear using the link functions
- How can I split my query result in 2 arrays?
- array_rand not working correctly?
- How to get post category list as select in front-end?
- Order a WP_Query by meta value where the value is an array
- How do I check if there is a tag in the title
- Using multiple variables to assign categories to an array
- Search.php gets metadata from first post
- the_post(); prints out style text into my HTML?
- orderby meta_value_num is not working, giving default order
- WordPress Conditional / Multiple Taxonomy Query
- How can I modify this code to make the search box include tags and meta
- WordPress Search Ajax + Isotope + InfiniteScroll
- Show related products by attribute based and certain conditions
- How to retrieve taxonomy Metabox fields in frontend
- How to call my PHP function with AJAX ? wp_query
- Query by pagename not Working
- can I extend the WP_Query class to deal with ‘duplicate’ posts created by joining to wp_posts?
- Create category after theme setup and modify the default one
- Getting info about selected posts using one WP_Query
- WP_Query To Display Product Of Brand On Taxonomy Page
- How to display last whole post on the homepage
- Custom Taxonomy – fields
- taxquery taxonomy get terms
- How to return count of items found in SQL query
- How to define a custom hierarchy for terms?
- wp_query beginner
- WordPress using get_term to retreive slug not working as expected
- WooCommerce – Print Processing orders [closed]
- List of child pages fetch next results at link click
- How to get category pages to look like a certain archive page?
- How to get all the terms of a post
- Post Title Not showing up
- reorder a WP_Query, using a dropdown
- Custom query_posts() parameter
- Why does a meta_query break this WP_Query?
- How to modify this function to exclude also the post belonging to a specific category?
- Display biography post for today’s birthday person
- Custom taxonomy with page post type – WordPress
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- How to sort custom sortable column by custom table value
- /page/2/ redirect to 404