You can use meta_query in WP_Query
$args = array(
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'subject',
'value' => 'Subject Two',
'compare' => 'LIKE'
)
)
);
$query = new WP_Query( $args );
Related Posts:
- Query post types with multiple keys
- Display only one post each WEEK
- What does this PHP function code mean? [closed]
- what is the correct way to compare dates in a WP query_posts meta_query
- Restrict custom post type to only site administrator role
- How to get post content by calling ajax?
- How to show all posts of the category in wordpress?
- Get the ID of the latest post
- Linking Two Post Types
- How to force one column layout on custom post type edit page?
- modify all posts of a category to “no comments allowed”
- Limit the post for differents custom post type in the same wp_query
- How to hook get_terms() to only show count of posts that have custom meta
- Why is the »_builtin« parameter not advised in »register_post_type()« for custom post types?
- Showing current taxonomy terms
- Loading post content in FancyBox
- automatically create taxonomy with same name as post title
- Query posts by custom post type and custom taxonomy
- Assigning a role to a specific custom post type (and ignoring other post types)
- Display posts in random post types
- Custom Post Type by user
- saving custom post type data to different table in wordpress
- ascending order custom post type
- [Plugin: Posts 2 Posts] Changing display order of connections
- same archive template for different custom post
- Get the post children count of a post
- Quickest way to get last or oldest post date – WP Query
- How to delete all posts from a custom post type?
- Check Title Unique Or Not and If not error message and dont save
- Remove All, Published and Trashed Post Views in Custom Post Type
- How to post twitter like updates on wordpress
- Show Two custom Post type and their posts on category page
- apply filters only to specific post listing without check the url parameters
- Custom post type and body_class: Remove “blog” class
- Setting posts per page in query_posts
- How to insert content from another Custom Post type into Post?
- Deleting Custom Post type data using mySQL command
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- List children on child post
- Get latest 3 posts from multiple CPT in one query
- Conditional Query of Custom Post Type and custom taxonomy
- will post_id ever change? Can I safely use post_id for custom queries?
- List custom taxonomy specific to one custom post type
- Custom Post Type Query for Sidebar Doesn’t Work on Front Page
- Meta query for custom post type ignored in main query
- Show titles, date of all posts on single category page
- Update postmeta Parent when post_status child change
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Allow users to create posts without logging in?
- Limit the post for differents custom post type in the same wp_query
- How to sort posts in a custom post type by title in ascending order by default?
- attach CPT data to a taxonomy
- Get_the_terms restrict output
- Custom post type menu
- YOAST SEO won’t work on custom post type archive [closed]
- Separate Content from gallery (custom post type)
- WordPress Count posts within a custom post type
- List all posts in taxonomy term
- Custom post type tags not showing in search
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- How set template for “custom post type” individual post
- Why is my custom post content only viewable when signed into WordPress?
- Create a post automatically if search result has zero results
- custom post type and user post count shortcode
- Adding specific custom fields (images) to post excerpt
- minimize wp_query call to database
- Limit posts per page depending on the size of a div?
- Use WP pagination functions on a custom page template
- Delete Post by User
- update a posts of other custom post type
- creating a custom post template
- Problem to get the link of the default ‘post’ post type like the orther custom types
- One Post with different content, depending on a Page
- How to set class to “current-page” on the currently viewed single post within a CPT
- Custom Post Type
- How to get Last post Id of custom post type in wordpress
- query_post causes the posts to be loaded twice on load more posts
- Display all post types together
- Query Posts From Multiple Post Types
- Turn post into simple slideshow
- WP Build-In Post selector for CPT
- What’s the best way to show custom post types? With page template it’s not perfect!
- How to apply order on custom taxonomy and custom meta key on custom post type
- Query multiple post of which one by taxonomy
- Inserting two categories
- How to make a template for a specific post of a custom post type?
- How to delete unnecessary custom post types in the UI
- How to create a job post by email parsing? [closed]
- show posts under custom post type with same autj
- How to automate the creation of advanced layout article/post
- display posts, pages and custom post types from another wordpress site
- is therer any wordpress function to retrieve a specific html element from post content
- How to develop Knowledge center in WordPress Website
- Multiple templates for custom post type
- Auto-generated posts not showing in backend (but being counted!)
- Post Query not working
- If/Else child list for Custom Post Type single template within loop?
- Problem with customize page cached in WordPress.com [closed]
- save_post affect creation and deletion
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?