@jacob-peattie answered the question in his comment – I used the wrong key to set the number of posts my query generates. Swapping numberposts
with posts_per_page
solved the issue.
Here’s the final query:
@php
$cats = get_sub_field('reviews_category'); // gets the custom field categories
$args = array(
'post_type' => 'testimonials',
'posts_per_page' => -1, // this line updated
'order' => 'DESC',
'orderby' => 'meta_value',
'meta_key' => 'date',
'tax_query' => array(
array(
'taxonomy' => 'testimonial_categories',
'field' => 'term_id',
'terms' => $cats
),
)
);
$query = new WP_Query($args);
@endphp
Related Posts:
- Exclude a category from WP_Query
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Show Post Count of a Category
- Querying Term Posts in Loop
- wp_query check if integer exists in custom field’s array
- WP the_posts() on single-cars.php get category link
- WP_query – Filter by tax_query and meta_query using multiple select
- WP Query Conditionally query meta and taxonomy
- WP_Query not using relation key as expected and not producing any results
- WP_Query by a category id and a custom post_type
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Counting Posts of a Given Post Type Having a Specific Taxonomy?
- category__in not working on custom post type
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Querying Posts by Taxonomy From Alternate Network Site
- Combine tax_query and meta_query in WP_Query
- Custom edit post column – category not showing
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Query for posts in 2 taxonomies
- Custom post type taxonomy template
- Taxonomy structure of Sport site
- Paginated Taxonomy Term Archive including one post per term
- Filter posts with meta_query NOT IN where value has multiple values
- Query for custom post type objects in a taxonomy and with a meta value
- get_categories() for only CPT
- custom taxonomy archive by year
- Is it possible to create a shortcode that will query a post based on taxonomies?
- wp_query to find posts by year and month
- Custom Post Type Loop within Shortcode
- Weird problem happening with custom taxonmy when creating/updating posts
- Pagination on category page with custom post types
- Display CPT posts based on specific taxonomy
- WP_Query: include custom post type only with specific meta value
- showing custom post types of a certain category only
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Show custom post type filtered by category
- Show a Category X’s custom post type on Category X archive page?
- Filter CPT posts by one or more categories
- Getting categories of posts under a custom taxonomy
- Custom WP Query on custom meta and sort by multiple meta keys value
- Custom taxonomies relationship
- WP Query with categories only shows one post and ignores the category
- How to edit this code to get the categories in achieve page?
- Hierarchy and access control for Custom Post Types (CPT)
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- WP_Query orderby and tax_query
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Possible to filter custom post type with multiple meta data?
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Get parent category id from child category page for custom taxonomy
- WordPress wp_query() basic question about args
- How to add current custom taxonomy slug to body class
- How to Display Posts From Category Within a Custom Taxonomy?
- Disable custom taxonomy on admin bar
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- how to get this tax_query working?
- find custom post type post by searching its custom field with my string
- The Difference Between Categories and Tags and Taxonomies and Terms
- WP_Query of custom post type sorted by meta_key has unexpected results
- How to get the post terms from a child taxonomy
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Sorting by meta_key different to search criteria?
- Using WP meta query to show custom post types by a start and finish date
- Custom post not appearing under custom taxonomy category
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- how to organize my categories or should I do custom post types for some?
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- How to divide Subcategories into pages of parent category wordpress
- Custom front-end form for adding post – Category problem
- set object terms after some some time of published post – functions.php
- Sort custom posts by date and then by taxonomy
- build child and anchestor three from post parent
- meta query condition don’t work
- How to search through all child taxonomies using WP_Query?
- Custom query result empty on page 2
- Show Custom Post Type based on Category on Archive Page
- WP_query sort by taxonomy
- Not able to get my custom search result using meta_query and tax_query together?
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Only show current category post
- Query events post type after current date and timezone
- WP_Query for CPT with filter by another WP_Query
- How to pass taxonomy terms to WP_Query along with $args?
- Display custom Taxonomies same as listing Categories
- Custom Taxonomy Query by Taxonomny not working
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Custom Query With Multiple Meta Key Value
- Storing/querying custom date data
- WP Query Post Type with same Taxonomy name
- Remove slug from Custom Category Permalink + dual-category permalinks
- WP_Query() displaying past post / event
- How to add categories to a custom post type using wp_insert_post($new_post);
- WP Query – Can’t get posts with specific taxonomy