I honestly don’t see how that works at all since get_the_term_list returns an HTML string.
First, you need get_the_terms and wp_list_pluck.
Second, you need a tax_query. That {tax} = {term} pattern is deprecated.
$this_post = $post->ID;
$args = array(
'post_type' => 'dir_entry',
'posts_per_page' => 10,
'orderby' => 'date',
'order' => 'DESC',
'post__not_in' => array($this_post),
);
$terms = get_the_terms($this_post,'post_tag');
if (!is_wp_error($terms)) {
$terms = wp_list_pluck($terms,'term_id');
$args['tax_query'] = array(
array(
'taxonomy' => 'post_tag',
'field' => 'id',
'terms' => array_values($terms)
)
);
$query = new WP_Query($args);
}
Related Posts:
- Why is my WP_Query not working when tax_query terms are an array?
- How to add terms to my tax_query based off of the current post
- Pass array of taxonomy terms to wp_query
- Formulate a url to show posts with both taxonomy terms
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Order by slug in get_terms with multiple taxonomies
- Function get_queried_object() return NULL in custom taxonomy
- Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
- Get authors by term id or slug
- Taxonomy order exception for specific term
- How to Order a list of taxonomies? orderby?
- How to add custom meta to ‘pre_get_terms’?
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Only show tag with the same id as the post
- Save queried result into database
- taxquery taxonomy get terms
- How to show terms from another taxonomy
- How to define a custom hierarchy for terms?
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- Show posts without term
- Search custom taxonomy term by name
- How to display post from current Taxonomy in archive page?
- Display posts the match taxonomy term linked from wp_list_categoies?
- Get list of posts which have at least one term from a custom taxonomy with WP_Query
- Display certain amount of posts on taxonomy archive page
- List taxonomy terms plus their latest post ordered by post date
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- Filter and list posts of a custom taxonomy
- List all custom post type posts from a given category?
- Filtering posts by custom field value not working
- Order taxonomy terms in alphabetical order
- Empty tax_query array returns an empty array
- How do I search inside specific taxonomies in WordPress
- Get taxonomy terms only of the WP_Query current posts
- Output an array of terms for a ‘tax_query’ => array()
- WordPress Related Post by tags in Single.php
- 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
- WP_Query Not Recognizing Taxonomy Parameter in Custom Search
- is_tax() function not working as expected
- Advanced Taxonomy Queries WordPress
- Custom post taxonomies as tax_query terms?
- Taxonomy Query Relation field not behaving correctly?
- WP Query Args – Title or Taxonomy Value
- Slow queries on a huge database
- How to order posts by title after they have already been sorted by category
- wp_query args adding muitiple tax_querys
- Taxonomy and Date in same query?
- Automatically Query Parent Taxonomy
- How Can I Change The Tax Query For The Main Loop For Taxonomy Archives?
- Custom taxonomy.php not working
- WP_Query for a taxonomy with different taxonomy types
- Using custom taxonomies in a query
- get term id from term name
- Get Child Category only
- Getting the post terms ‘wp_get_post_terms’ per post when within the functions.php file
- How to print term name inside wp post loop
- Get posts in taxonomy randomly
- Loop posts based on permalink term
- Using WP_Query for categories instead of get_terms
- Grabbing taxonomy terms and inserting them into an array
- Don’t repeat posts from children in parent taxonomy query
- Show multiple tax_query from 2 or more post_type in a single code
- Custom taxonomy in WP_Query not working
- Use get_cat_ID to retreive multiple category IDs
- Strange behaviour of hierarchical taxonomy archive
- display ACF repater field in archive page
- How to use the Term Object from a custom select field in a query
- WP Query by 4 different taxonomies
- Display Custom Post Type Based on Taxonomy With WP_Query()
- wp_query with meta_query and tax_query
- Get categories within specific term
- WP_Query paginate with one term per page?
- How to break up output of posts for different terms on same page?
- Custom category page with taxonomy filters
- Taxonomy archive, categorised by other taxonomy, not hiding empty taxonomies
- pages shortcode filtering by category
- get term objects and post objects in query
- Taxonomy Terms That Don’t Exist Display Results
- Category Archive not working for pages
- How can I get all the posts that are related with a specific taxonomy term?
- WP Query with sticky posts and tax_query
- Search format not matching taxonomy query
- Add a custom variable to query page object
- How to get several fields from wp_query?
- Multiple Orderby is not working right
- tax_query not working properly with get_posts
- query only direct child and sub-terms of a current term archive
- Get access to all terms associated to each post that the wp_query loop displays
- Custom query for certain post type OR another post type with a certain category
- I need to get all categories from a WP_Query
- taxonomy-{term}.php terms pagination returning 404 after a certain page
- Using WP Query, I want to include all posts in category 1 as long as they are not also in category 2
- Filter on one post type with taxonimy and get other post type
- Include custom post type that matches taxonomy field in another custom post type
- Showing all posts of the current custom taxonomy on archive page
- Custom tag template to list posts in ASC order