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
- WP_Query not using relation key as expected and not producing any results
- WP Query filtering by custom category not showing all relevant posts
- Custom post type post_type_link gives “page not found” on any other custom post type
- How to get all posts assigned to a taxonomy term only?
- The most recent post of custom taxonomy
- Custom Taxonomy page redirecting to 404 page
- Get list of all Topics in use by a custom post type
- One-Time Script TimeOut for Large Data
- Changing an item in drop down after 5 latest posts per taxonomy
- How to add a new column in custom post type list?
- Exclude Posts in a Given Category
- Custom post types with child taxonomy not visible in admin
- Not Able to List CPT Based on Taxonomy Term
- Help with Travel Guide Setup
- Custom permalink with custom taxonomies for custom post type
- Meta query broken since 4.7.4 Update
- Best way to have one product in both rental and sale parent category
- Create Inclusions and exclusions
- 404 error next-page [2] PageNavi custom type taxonomy
- Custom taxonomy archive slug overwrites static page
- Slugs on hierarchical taxonomies
- Custome post type “tags” pick default archive instead of custom post type archive
- Template hierarchy changes when custom post-type permalink leverages custom taxonomy
- Add tags to a “pending” post before publishing
- Show tags of custom post types in WordPress
- How do I retrieve the title of a term of a custom post type with custom taxonomies?
- Custom taxonomy- only output relevant terms
- Group based routing and administration
- How should i name the .php file to show custom posts under a taxonomy’s term?
- Post types showing tables…Can I do that?
- Show posts for current taxonomy
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- order taxonomy alphabetical
- What’s the most efficient way to get two queries based on an if statement?
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- Adding Custom Taxonomy Along-with Post Name in Post Type Permalink
- I want to display my custom post type arranged by taxonomy
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Customize url from the_terms
- Pretty permalink structure with multiple (AND OR) taxonomies
- Custom post types not displaying per category
- Taxonomy’s title
- Display all posts from single taxonomy term
- Display a Custom Post Type within another with hierarchically slug
- Problems with the WP_Query query for a Custom post type
- Connect 8 Taxonomies to One (Main) taxonomy. How to?
- I want fetch custom post with taxonomy id
- Filter a custom taxonomy from displaying a button all other taxonomies can show
- Front page url permalink
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- Custom taxonomy term links out of order
- How to shows CPT which has specific meta key?
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Custom post type category archive URL redirects to home page
- Associate custom CPT with another CPT’s taxonomy and rewrite permalinks
- Custom post type taxonomy template and URL confusion
- Display all Custom taxonomy terms and their relevant custom posts
- Custom Post Hierarchy and users
- Unexpected behavior from custom taxonomies
- Breadcrumb that shows multiple custom taxonomies
- Querying, storing, and using data from 2 separate custom post types
- What am I doing wrong with my taxonomy?