To select posts that have a meta value, use the EXISTS comparison operator.
$args = array(
'post_type' => 'jobs',
'posts_per_page' => 12,
'paged'=> $paged,
'tax_query' => array(
array(
'taxonomy' => 'job_category',
'field' => 'slug',
'terms' => $term->slug,
)
),
'meta_query' => array(
array(
'key' => '_shop',
'compare' => 'EXISTS'
)
)
);
Related Posts:
- wp_query check if integer exists in custom field’s array
- WP_Query not using relation key as expected and not producing any results
- How to Add Custom Fields to a Custom Post Type?
- Using meta_query, how can i filter by a custom field and order by another one?
- WP_Query orderby custom field then post_date in one query
- clients list using wordpress
- Filtering a WP_Query meta_query by numeric values isn’t working
- Custom Taxonomy Template Post List with Sort Order
- Creating Photo Gallery System with Custom Post Type
- Querying custom post type with 2 custom fields (date-range)
- How Can I save multiple records in same meta key?
- How to do a custom bookmarks post type?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- How to select one major category (or custom taxonomy) for a custom post type?
- Automatically assign a custom post to a custom taxonomy based on custom field value
- Custom Taxonomy order by Custom Field
- front end radio custom taxonomy with custom post type
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- Is there any performance consideration when using Custom Post Types?
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- How to add custom fields to admin UI and REST API response?
- Display custom post types with custom date field value (before today) & order by custom date field
- Get Custom Field Values by Another Custom Field in WordPress
- Displaying Metabox value (custom post type taxonomy)
- Automatically populate a hierarchical taxonomy from a custom field
- Filtering by Post Meta Custom Fields – Performance
- WP_Query: include custom post type only with specific meta value
- Returning a list of custom post types excluding those without a specific meta_value
- How to bulk copy custom fields between custom posts?
- 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 filter wp_list_categories output with some custom post type meta query?
- Meta Query Not Returning Output Despite Having Matching Values
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- Dynamic dropdown select values depending on other custom field value
- First custom field value (out of several) displayed twice after query
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- How to Output which matched meta_keys were found from custom_type_posts?
- Possible to filter custom post type with multiple meta data?
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- filter search custom field query
- How to let users choose where to search for posts?
- Query based on custom fields start and end date
- Custom post type’s extra fields – how to handle?
- Targeting categories in custom fields
- Custom taxonomies to define versions of a product
- Getting a custom post’s custom field based on another custom post’s custom field select
- Custom Taxonomy Search result page
- Many to many to many custom post relationships
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Custom Query: If One Post Object Field Value Is The Same As Another
- Reusable metabox backend and frontend
- How to populate a Gravity Forms Custom Post Field (dropdown type) with custom taxonomy terms? [closed]
- Custom post type name and assigning custom taxonomy
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Building a Portfolio and need some direction
- Custom post types category
- Custom Taxonomy dont save in a frontend form for post a custom post
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Making a form for user to add new custom post with custom taxonomies and custom fields
- Should i use custom post type for a custom footer?
- How do I ensure that post_type and Taxonomy use the same slug?
- Custom taxonomy terms as children of multiple custom post types
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Dynamic template page calling shared taxonomies CPT or Plugin post type : how to clone taxonomy for plugin + set up dynamic shortcode
- Using OR relation in meta_query to check for a value before sorting by another
- Display Custom Field or Custom Taxonomy in front page /post/product
- Orderby if between two meta fields
- wp_insert_post deleting previous post custom meta
- Show posts from WP Custom Post Type selected from a field in a metabox
- PHP Warning with Custom Fields
- meta query multiple values for the same key
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- Adding a Section for Visitors
- Custom taxonomy template for custom fields loop [closed]
- Meta_Query refuses to return results
- Sort loop by custom field from different post type
- Meta_query by date for Events archive
- What’s the most efficient way to get two queries based on an if statement?
- Query events post type after current date and timezone
- Need some suggestion/help with custom post types project
- predefined custom field on registration page
- Selecting posts older than the current Unix epoch timestamp
- Unable to get the upcoming events for custom post
- custom taxonomies are not showing up in get_taxonomies
- Advanced search form with filters for custom taxonomies and custom fields
- WP_Query arguments: Loop through custom post type – get all entries except excluded meta_key?
- loop through custom post-type with two meta_keys
- Querying meta values within an array
- Custom Post type as Taxonomy
- How to change order of custom post types. I want Featured post to come first
- Check for custom field value in different post type than current one and do something
- Function to Compare CPT Post Custom Value with Default Posts CF Value
- WP Query Conditionally query meta and taxonomy
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- Custom Sort Order for Custom Post Type Taxonomy
- Meta query with ACF relationship field
- Query custom fields with three dates – start and end does not work