This is why code indentation is so important! Your posts_per_page
argument is actually part of your tax_query:
'post_type' => 'regularproducts',
'tax_query' => array(
array(
'taxonomy' => 'products-category',
'field' => 'slug',
'terms' => $course_terms, //the taxonomy terms I'd like to dynamically query
'posts_per_page' => '4'
),
),
'orderby' => 'title',
Instead, you should have:
$wp_query = new WP_Query(
array(
'posts_per_page' => '4',
'post_type' => 'regularproducts',
'tax_query' => array(
array(
'taxonomy' => 'products-category',
'field' => 'slug',
'terms' => $course_terms, //the taxonomy terms I'd like to dynamically query
),
),
'orderby' => 'title',
'order' => 'ASC',
)
);
Related Posts:
- Query multiple taxonomy in Custom Post Type
- WP_Query for custom taxonomies showing posts from non-specified terms?
- How to get all taxonomies of a post type?
- Saving Taxonomy Terms
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Custom Taxonomy as checkbox or dropdown
- Taxonomy: Why ‘with_front’ => false DOES NOT WORK?
- How do I append multiple taxonomies to the URL?
- Custom Taxonomy as Dropdown in admin
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- How to completely disable a taxonomy archive on the frontend?
- How to limit the number of terms (terms acts like categories)
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Custom taxonomy not showing up when adding a new custom post type
- How do I list custom taxonomy terms without the links?
- How to list custom taxonomy categories?
- Custom Taxonomy Template Post List with Sort Order
- wp_insert_term doesn’t work with custom post type’s taxonomy
- How to list all categories and tags in a page?
- Retrieve single term slug
- Taxonomy archives based on Custom Post Type
- Create an archive page for custom taxonomies
- Get the ‘slug’ of a custom taxonomy
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- How to show term-specific post list, without posts associated with child terms?
- SQL to update custom post taxonomies
- How to get the parent’s taxonomy?
- Querying Posts by Taxonomy From Alternate Network Site
- Get the most popular terms for a custom post type
- Include custom post type in “all posts”
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- wp_insert_post custom taxonomy
- Custom Post Type: How to display all of same taxonomy?
- Taxonomy-{taxnonomy}.php is not working
- Display taxonomy term only if there’s a value
- Include different loop templates in search query
- Remove “-2” from a Toolset Types URL with the same post name
- Get list of terms of current taxonomy archive for another taxonomy
- Get all taxonomies for all post types
- Custom post type taxonomy template
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Associate Taxonomies Across Post Types
- Use the_taxonomies() to create a simple list
- Listing taxonomies from custom post type
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Taxonomy Templates
- Custom Post Type and Taxonomy combination
- Show Post Count of a Category
- WP_Query search posts by custom post type and custom taxonomy
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Relationship between two taxonomies and a custom post type [closed]
- Menu Multiple Taxonomies
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Show Two custom Post type and their posts on category page
- How to make a custom taxonomy selectable in post publish area?
- How to filter custom taxonomy categories on archive?
- Querying Term Posts in Loop
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- Fetch taxonomies by custom post type id array
- How to check the terms in single custom post type template
- get_terms showing all categories instead of the ones assigned to a specific post
- How can I move a custom taxonomy and its data from one post type to another?
- Custom page template for category taxonomy
- Custom Post type is being ignored in query
- Query Multiple Taxominies Across Multiple Post type’s
- Order By Post Type ThenBy Taxonomy
- Custom query to filter posts that have current post as a taxonomy [closed]
- How do I get array of types associated with a taxonomy?
- wp_set_object_terms() not adding new term to custom post and custom taxonomy
- Display all posts in main category and 1 subcategory
- Am unable to reset a query properly
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- Get next and previous 3 posts in a term in single post page
- Custom Taxonomies not appearing in Admin
- Making certain categories of CPT not publicly queryable
- Search / Filter posts on Title/Content OR Tags
- Custom Post Type Taxonomy Filters
- Get parse_query filter to return slug instead of id
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Custom Taxonomy back-end customizations
- Taxonomy custom post type URL
- How do I move/order posts with a tag to the end?
- How to Filter custom post type by taxonomy?
- Is it possible to have dedicated page for parent/child taxonomy?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Get related posts of child term of custom post type
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- list taxonomies from a custom post type
- Display a grid of taxonomy terms at root taxonomy page
- Specific query for custom post type
- limit value taxonomy based on previous taxonomy value wordpress
- How do I display the taxonomy for a custom post type in an array
- How to conditionally redirect to the post from a taxonomy page?
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- Taxonomies relations