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?
- Custom Taxonomy as checkbox or dropdown
- 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)?
- How to show term-specific post list, without posts associated with child terms?
- Querying Posts by Taxonomy From Alternate Network Site
- Get the most popular terms for a custom post type
- Custom Post Type: How to display all of same taxonomy?
- Include different loop templates in search query
- Remove “-2” from a Toolset Types URL with the same post name
- Custom post type taxonomy template
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Taxonomy Templates
- Custom Post Type and Taxonomy combination
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Querying Term Posts in Loop
- How to check the terms in single custom post type template
- How can I move a custom taxonomy and its data from one post type to another?
- Query Multiple Taxominies Across Multiple Post type’s
- Am unable to reset a query properly
- 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
- Custom Post Type Taxonomy Filters
- Taxonomy custom post type URL
- How do I move/order posts with a tag to the end?
- Get related posts of child term of custom post type
- Specific query for custom post type
- How do I display the taxonomy for a custom post type in an array
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- WordPress Doesn’t Generate Taxonomy Archive
- Suggested Post and Taxonomy structure
- Display post content with respect to its title?
- Custom post with more than one custom taxonomy
- Get the taxonomy of a post hierarchically
- How to get list of taxonomy slugs ordered parents>childs?
- WP_Query orderby and tax_query
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Multiple tag cloud filtering
- Get url.com/post_type/taxonomy/term work!
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Rename a slug label
- How can I create an automatic drop down menu with my tags?
- How to define a term for custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- WordPress multisite – is it possible to have different taxonomies for each site?
- Query custom post types & Taxonomies and list them in a table on a page
- How to show list of taxonomy terms associated with specific post?
- Creating custom post type posts and associating them with a post from another custom post type
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Group Custom post type in a taxonomy page by its child taxomony
- Getting List of child terms from custom taxonomy parent
- Using page title as a link to term archive
- Query Custom Post by taxonomy multiple categories
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- How to get post count of specific taxonomy that have store name & category
- Duplicate slug/permalink issue while adding same post name
- How to divide Subcategories into pages of parent category wordpress
- Get the taxonomy value in the post loop inside the archive page
- Filter taxonomy by CPT
- How to show related posts of category on post within custom posttype
- Displaying all posts by category and showing content on click
- Get all posts for custom taxonomy term
- Listing all custom posts having a specific taxonomy whatever the terms
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Display custom tax in “while” loop
- tax_query not working?
- Showing taxonomies with terms that are attached to custom post
- Custom Taxonomy page redirecting to 404 page
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- Connect 8 Taxonomies to One (Main) taxonomy. How to?
- Filter By Term Not Working – Custom Post Type
- Get posts of an specific term of a custom taxonomy
- Custom Taxonomy is disabled on Edit page
- Override “Parent” input for custom taxonomy
- Custom post type post taxonomies
- Query Only Show Text on Posts With Certain Taxonomy Tag
- how to limit query_post to first page?
- Check if taxonomy is attached to at least one post in a post-type
- Looping taxonomy in taxonomy?
- Listing custom post type items from a couple of custom taxonomies
- Custom posts and custom taxonomies for many products and categories?
- List custom taxonomy terms
- How do i get the taxonomy term name on the CPT archive page?
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy listing issue – does not display how I would like
- Show custom category archive as front page and remove taxonomy slug from urls
- Taxonomy Archive URL + Template