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
- WP_Query on custom taxonomy -> Location and Activity
- Include custom post type that matches taxonomy field in another custom post type
- Can I force WP_Query to return no results?
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Get array of posts from the current archive page loop
- In loop: posts have thumbnail AND other variables
- Add inline HTML to posts published within last 24hrs
- Move posts to top of WP_Query if in certain Taxonomy?
- Display different number of posts from one category on the different pages
- Improving WP_Query performance for multiple taxonomies
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- Implementing an OR statement to wordpress wp_query
- Get List of all the Authors
- WP_Query, tax_query and term_meta: How to?
- Operations with custom fields values in a loop
- Refine search results using WP_Query
- How to pass many ids in post__in?
- How to show subcategories using loop?
- Sub-loop / nested loops Best Practices
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Check if loop has any categories?
- New WP_Query loop in admin causes problems
- Change query from cat id to slug or name?
- Using Wp_Query without the loop?
- Custom WP_Query id
- How to set an alternate posts_per_page value for default queries in different templates
- Returning One custom taxonomy term name
- How does WP generate the default $query in WP_Query based on the URL?
- how to get category`s slug in WP_Query loop?
- How I can repeat 2 HTML templates in a WordPress Query?
- Grabbing taxonomy terms and inserting them into an array
- check if a taxnomy queried in $wp_query?
- List terms of custom taxonomy if matches other taxonomy
- Offset WP_Query by negative 1
- WP_Query orderby random do not repeat infinite scroll – one loop
- Advise on Templates for Custom Queries
- How to pass the current content of $wp_query to a new page?
- Why is my pagination /page/2 taking me to index.php?
- How to separate two columns from one content on a page template?
- Can I alter the main loop to ‘orderby’ a custom callback?
- wp_query with meta_query and tax_query
- WooCommerce | AJAX | Product Pagination | Help me implement Ajax Pagination
- Avoid removing duplicate posts
- Regarding a custom loop and output HTML tags
- Second WP_Query loop shows data from main query
- My entry results are not consistently alphabetized
- Meta Query if Values Don’t Exist
- Get post Number with local loop and template
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- Custom query for tag and custom tag from 2 post type
- Problems with WP_Query, Loop, a condition and Posts per Page
- List posts of terms but exclude one term
- Hiding all posts/products/pages from a site based on a custom taxonomy/domain name
- Post data in separate divs with incrementing class using WP_Query
- Order posts with custom taxonomy array
- How to get rid of extra Untitled Article in html5 document outline when using new WP_Query?
- I need to get all categories from a WP_Query
- Unexpected number of loops in while