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
- Put ACF function output code the_terms
- How to extract information from a wp_query result?
- posts_nav_link pulling in multiple post types
- Taxonomy term count
- Displaying Event within two given time frames
- Remove Post if Advanced Custom Field is checked to fix paging
- How to get all the items of a taxonomy even if it does not have a custom post type?
- Toolbar Hidden in a Virtual Page
- WordPress custom taxonomy
- Filter unique custom field value based on custom taxonomy category or other custom field
- displaying a fall back query if there’s nothing in the post-type category
- How to break up php code to avoid echo
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- WordPress SQL JOIN query
- PHP displaying wrong custom taxonomy images
- Using multiple variables to assign categories to an array
- Search.php gets metadata from first post
- Avoid WP_Query’s duplicate posts with taxonomies
- the_post(); prints out style text into my HTML?
- WP_Query and help with the loop for magazine front page
- Modifying WP URL handing code?
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- orderby meta_value_num is not working, giving default order
- Wp Query : Order by distance lat,lon
- WordPress Conditional / Multiple Taxonomy Query
- How can I modify this code to make the search box include tags and meta
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- Hi need update in my terms for other taxonomy
- Free search and custom taxonomy query not providing the same result
- How to WP_Query posts order by parent title?
- How do I reset $wp_query in a function?
- search.php to search only the post title
- How to change the author box selection on a post to a custom taxonomy
- WordPress: Export/Import Yoast meta title & description to custom taxonomy
- Let current user know pending posts counts using wp_query
- Output product category link from WP_Query
- WP_Query – How to query all of post types categories
- get_terms with specific id order
- How to work Woocommerce pagination inside shortcode?
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- WP_Query for woocommerce products with a pattern as a post_title
- Page that lists publications by classifying them by taxonomy
- “pre_get_posts” orderby custom date field in different format?
- wp_query with multiple arguments with AND
- WordPress Search Ajax + Isotope + InfiniteScroll
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Passing in MySQL prepare statement parameter separately throwing error
- Show related products by attribute based and certain conditions
- Replace a single variable with add_filter
- Display acf taxonomy attachment
- How to hide a child category and show his parent category
- Nested Queries of decreasing specificity
- get different meta-data of a complicated query at the same time
- Wrong pagination results, page counter resets when navigating
- Is it possible to order posts using multiple meta queries, i.e. show posts from first meta query, then the second?
- Sending simple variable on single page to WP JSON
- How to exclude meta no index pages from wp_list_pages
- Using a new WP_Query inside the loop
- wp_Query with mutuplea values returns all posts
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Load more posts using AJAX based on posts inside WP_Query
- Only show tag with the same id as the post
- in_array not working on dev server but works on localhost
- How to retrieve taxonomy Metabox fields in frontend
- wp_query – Exclude the first thumbnail from lazy loading on archives
- meta_query search names when they have middle initials
- How to call my PHP function with AJAX ? wp_query
- WordPress sorting posts by date and title using a dropdown
- Custom search query on WordPress page not working
- WP query posts BUT show the most recent and one per author
- Save queried result into database