I managed to do it. I used the following query parameter:
'tax_query' => array(
array('taxonomy' => 'wpccategories',
'field' => 'slug',
'terms' => $termz
)
)
With $termz
being: $termz = wp_get_object_terms($id, 'wpccategories', array("fields" => "slugs"));
The problem I struggled with was that I needed to use singular 'field'
with singular 'slug'
in the tax_query
(I knew this) but I needed to use plurar in the wp_get_object_terms
function. So the other way around of any other kind doesn’t seem to work.
Related Posts:
- Show posts without term
- Custom taxonomy.php not working
- Check if a post has term inside loop
- display ACF repater field in archive page
- Custom loop – Isolating post meta output depending on current query taxonomy terms
- Display posts the match taxonomy term linked from wp_list_categoies?
- Custom archive page based on array of categories and tags
- List taxonomy terms plus their latest post ordered by post date
- WP_Query use for a filter with multiple Taxonomies and Terms
- tax_query shows no results if nothing is selected
- Get array of current post term ID’s
- Query Custom Post Type Order By Taxonomy Field
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Function get_queried_object() return NULL in custom taxonomy
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- How to Filter Posts by Custom Fields?
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How to order posts by title after they have already been sorted by category
- Search form not working with custom query?
- Post loop for all taxonomy terms
- Filter Custom Taxonomy Posts
- get all posts associated with a custom taxonomy
- How to add custom meta to ‘pre_get_terms’?
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- How to print term name inside wp post loop
- Query Taxonomy By Page Title
- Use have_posts() with array of post results retrieved by $wpdb->get_results
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- How do I stop the same post showing multiple times in a archive?
- Get categories within specific term
- list all post who have mutual taxonomy as current taxonomy!
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- How to define a custom hierarchy for terms?
- Taxonomy Terms That Don’t Exist Display Results
- Output ACF field dynamicaly within a taxonomy loop [closed]
- tax_query not working properly with get_posts
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- Resetting post data to previous loop in nested loops
- Pagination returns 404 after page 20
- Make loop display posts by alphabetical order
- get custom post type by tag
- Group posts by custom field
- Woocommerce custom loop to show all the products [closed]
- How to show the posts of some category first, and then all other
- Pagination stops at page 6
- Paginated HTML Sitemap
- Display link to taxonomy archive only if it has posts with certain custom field values
- How to limit total number of posts in wp query loop?
- Custom Post Type Loop within Shortcode
- Get list of terms that have posts in another term
- Pagination is broken and I need help fixing it
- How do I Use Multiple Loops with WP_Query?
- How to vary post loop results layout and resume?
- Display CPT posts based on specific taxonomy
- Filtering WP_Query Dynamically on the Front-End
- Get a post from other loop each n-posts in the main loop
- Loop returning only 1 result
- WordPress ignoring LIMIT / posts_per_page despite being in wp_query
- Conflict with get_posts and the_content
- How do I rewrite this loop as a new WP_Query style-loop?
- How to provide meta_key array to wp_query?
- Exclude taxonomy term from all loops, but having it on widget
- Meta query compare for ID’s greater than specific ID
- display posts of custom post type with custom taxonomy
- WP_Query with one category in args shows other categories
- Ordering posts by custom field and grouped by month
- Wp_query…a type of term a different div
- relation OR instead of AND – Filtered term ID’s in loop
- Query custom taxonomy for category including children
- Cant’ Display Custom Post Type Title Base on Tax Terms
- How to break up php code to avoid echo
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Why does apply_filters behave different inside and outside a loop?
- Custom template for password protected page
- Function the_posts_pagination() not compatible with WP_Query arguments
- Prevent Duplicate Post Counted by Query
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- How to show specify category template for both parent and child category
- Pagination inside the blog page not working
- Custom Query Pagination not working on static front page
- query all posts published by certain user id
- Adding additional taxonomies to wordpress taxonomy page
- modifying the loop multiple times with arguments passed through ajax to wp_query
- WP_Query causing links to not work
- Query Top Set Custom Taxonomy In Given Timeperiod
- Retrieving category pages from subcategory returns empty sets
- Iterate through ID’s in loop
- Loop through multiple custom fields with increasing number
- Different number of posts showing in development vs production server
- Multiple loops on a Search result page?
- Multiple loop for “featured” items returns wrong posts
- Pagination in custom query not working [duplicate]
- query_posts problem – need help
- How to write a query-function as a query-shortcode?
- First post outside of loop, homepage only?
- Pagination only showed when no category is set in wp_query