It looks like you forgot to set the field
parameter to search for slugs:
$args = array(
'post_type' => 'advertisement',
'tax_query' => array(
array(
'taxonomy' => 'group',
'terms' => array( 'homepage' ),
'field' => 'slug',
)
)
);
Notice that the taxonomy query uses the term_id
as the default search field.
I would also use another variable than $wp_query
to store the result of the secondary query.
I hope this solves your problem 😉
Related Posts:
- Get The Post Type A Taxonomy Is Attached To
- Custom Post type & Taxonomy URL structure
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Check if a custom taxonomy archive page is being displayed
- How to limit the number of terms (terms acts like categories)
- Two Custom Post Types, Share Two Taxonomies
- Permalink rewrite with custom post type and custom taxonomy
- Semantic URL Custom Post Type and Taxonomies permalinks
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Add custom taxonomy to custom post type
- How do I add a custom post type to the Featured Content in twenty fourteen theme?
- Ajax filter with custom taxonomies
- Querying Posts by Taxonomy From Alternate Network Site
- Is there An Input Checkbox Option That Works like `wp_dropdown_categories()` To Use In A WP Search Form?
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Using pre_get_posts to Filter Posts
- Adding Custom Taxonomy Archive Link to Nav Menu Shows Up As (Invalid)
- get_categories() for only CPT
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Custom Post Custom Taxonomy Data Not Saving in Edit Screen
- CPT Search Form with Taxonomy filter & Or
- How-to leverage WordPress for creating Extended Social Profiles
- Weird problem happening with custom taxonmy when creating/updating posts
- How To Create A Custom Taxonomy 404 Page
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- Display CPT posts based on specific taxonomy
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Overriding taxonomy and custom post type
- How to use custom taxonomies to reference complex relationships?
- How to checked selected category checkbox when my custom post inserted from frontend
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- How to edit this code to get the categories in achieve page?
- Get general taxonomy name for a Custom Post Type
- WordPress uses url different from defined in rewrite arg of custom post type
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- List Taxonomy Terms based on another Taxonomy
- Display taxonomy terms, child terms and posts in a template
- Get url.com/post_type/taxonomy/term work!
- Ordering values entered in Custom Taxonomies
- Show fields based on taxonomy selection in editor
- Permalinks: custom structure for taxonomy – tags?
- How to get WordPress term attached to the Post?
- Add “Select All” to custom taxonomy
- Disable custom taxonomy on admin bar
- How can I merge this function(s) that inserts terms to a custom taxonomy with this other that adds a custom taxonomy filter?
- how to show records that don’t have custom meta value
- SEO Concerns With Rewrite Rules
- Empty taxonomy items for CPT in admin grid
- How to get_term_meta on single custom post?
- Display Custom Post Types Glossary
- How to fetch custom post types with its full data on wordpress?
- Query only current post type using taxonomy
- Template for custom taxonomy for custom post type broken
- How should I structure complex content hierarchies?
- Querying two different post types with the same taxonomony
- Change permalinks for custom post type based on taxonomy term
- Convert Custom Taxonomy Posts to Normal Posts
- Custom Post taxonomy template
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Need help with Custom Taxonomy + Custom Post Type
- Right way to store a large set of similar information on website? [duplicate]
- How to prefix custom post type URL with custom post taxonomy term?
- How to debug failing updates for custom post type?
- URL for archive of custom post type with 2 taxonomy terms
- Posts per Page on custom Taxonomy Template
- Display 3 level taxonomies
- Recovering data about custom post and taxonomy types
- WP_query sort by taxonomy
- Custom Post didn’t display on tags page
- Custom fields for taxonomies with custom value for each post
- Add Custom Term to RSS Feed Titles
- If custom taxonomy exist on post?
- Error get_posts with Custom Taxonomy and OR relation
- How to show post which has the specific taxonomy terms?
- Custom Post Hierarchy and users
- Breadcrumb that shows multiple custom taxonomies
- YearWise Categorywise Post
- Hide Custom Taxonomy title if not associated with another Custom Taxomony
- How to add base permalink to custom posts?
- Custom Post Types and Pre Populated Custom Taxonomies
- Custom Taxonomy Query by Taxonomny not working
- Linking custom taxonomies and posts
- taxonomy term names in custom post type permalink structure
- How to show a custom taxonomy using a custom template
- Get Registered Custom Post Type to get All Custom Taxonomies
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Show custom taxonomies in admin panel under custom post type
- Plugins for putting Custom Post Types into the Menu
- Custom term link return 404 error
- Remove slug from Custom Category Permalink + dual-category permalinks
- Display associated taxonomy child name on single CPT page
- How is it possible to list custom post types by “category” like with simple posts?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Custom taxonomy meta fields
- Same slug for Custom Taxonomy archive and CPT archive – Rewrite rule not working
- Problem with shortcode
- Modify permalink of CPT archive to support two taxonomies
- WP Query – Can’t get posts with specific taxonomy