Since in your comment, you said that you just want posts with meta key lang=en
on a custom taxonomy page, the easiest way to do that would be to filter the query with pre_get_posts
before it is run.
function wpa_107371_meta_query( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
// only change the query on a custom taxonomy
// can check for a specific taxonomy if desired
if ( is_tax() ) {
//define our meta query
$meta_query = array(
array( // needs this nested array syntax to work
'key' => 'lang',
'value' => 'en',
'compare'=> '=',
),
);
$query->set('meta_query', $meta_query);
return;
}
}
add_action( 'pre_get_posts', 'wpa_107371_meta_query' );
Related Posts:
- WP_query – Filter by tax_query and meta_query using multiple select
- WP Query Conditionally query meta and taxonomy
- The Operator “NOT IN” Does Not Work In tax_query
- Order posts by (hierarchical custom) taxonomy terms and term children
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- Combine tax_query and meta_query in WP_Query
- Count number of posts which exist in 2 taxonomies?
- How loop through posts based on custom fields
- Displaying Metabox value (custom post type taxonomy)
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- Query Multiple Taxominies Across Multiple Post type’s
- wp_query check if integer exists in custom field’s array
- Tax query not producing any results
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- Why is this query not working? (Standard posts + custom post type)
- Using meta_query and tax_query at the same time
- How do I display the grand child items of a taxonomy term?
- How to display Related Posts based on number of taxonomy terms matched
- tax_query not working in template
- WP_Query parameter conflict
- Get category if used in a custom post type
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- tax_query (if the terms are empty)
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- Dynamic template page calling shared taxonomies CPT or Plugin post type : how to clone taxonomy for plugin + set up dynamic shortcode
- custom post type and a “sticky” position taxonomy
- How to search through all child taxonomies using WP_Query?
- Custom search for a custom post type in WordPress
- How can I get the last 5 element of this tax query?
- tax_query not working?
- Getting Custom Posts with Custom Taxonomy
- WP Query tax_query not returning posts
- Not able to get my custom search result using meta_query and tax_query together?
- Error get_posts with Custom Taxonomy and OR relation
- How to show post which has the specific taxonomy terms?
- tax_query showing no results
- Display all posts in a custom post type, grouped by a custom taxonomy
- Ordering Posts List By Taxonomy Terms?
- Templates for Custom Post Types and Custom Taxonomies
- post count is wrong when using same taxonomy for 2 different CPT
- Issues when rewrite rules collide?
- Add links to post categories and taxonomies in wysiwyg link modal?
- Custom post type archive with dynamic taxonomy filtering – is it possible
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Custom Taxonomy Breadcrumb Navigation
- Remove “-2” from a Toolset Types URL with the same post name
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Ordering Custom Post Types with WP_Query
- Is it possible to make tag archive page specific to Custom Post Type?
- Custom query variable – get wordpress to redirect to nice permalink url
- Programmatically adding posts
- Keep main articles and author blogs seprerate, News / Magazine like site
- How to create an advanced filter search?
- I can’t choose the custom taxonomy in my custom post type on Gutenberg
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Retrieve value of a category’s custom field
- How to save custom taxonomy from front end post submission
- wp_list_categories() – current-cat class also inside posts?
- Showing the custom taxonomy parent term and child term of a post
- Template for custom post with custom taxonomy
- Custom post type url with category
- Adding custom post category slug in permalink causes 404 error for pages and posts
- Taxonomies don’t show up on in the dashboard page for a custom post type in wordpress 5.22
- Remove slug in URL custom post type
- Taxonomies relations
- Adding custom taxonomy in same menu place with two custom post types
- Template files for Custom Post Type and Taxonomy
- WordPress menu with custom taxonomy
- attach CPT data to a taxonomy
- Listing all slugs?
- Creating a non-hierarchical Taxonomy that behaves like categories
- Custom Post Type not showing in main loop
- How to get xml file for a single post type?
- How to change single custom post template by custom taxonomy?
- How to query Posts from a custom post type which contains a custom taxonomy?
- How do I ensure that post_type and Taxonomy use the same slug?
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Not saving custom taxonomy while using ajax
- 404 – Taxonomy Archive Page
- Some posts not displaying by taxonomy term
- Custom taxonomy with custom post type archive page
- Multiple non-hierarchical custom taxonomies frequently used terms showing up in first selected taxonomy box
- I want to create pagination for my custom post type archive that i am displaying with loop
- Showing taxonomies with terms that are attached to custom post
- Saving Child Terms on front end not setting parent
- Custom taxanomy and custom post type – pagination leads to 404
- Help with Travel Guide Setup
- How to shows CPT which has specific meta key?
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Custom post type taxonomy template and URL confusion
- Custom post type AND custom taxonomy are not connected
- Loop with Custom Post Type and Taxonomies
- WordPress Custom Post Type and sort by Tags
- Using one custom taxonomy.php for two custom taxonomies?
- Add taxonomy to custom post type archive
- posting twice from an array?
- Custom taxonomy labels won’t display
- Custom post type with custom taxonomy