<?php
$args = array( 'post_type' => 'care-agency', 'meta_key' => 'wpcf-listtype', 'meta_value' => 'Enhanced Listing' );
$loop = new WP_Query( $args);
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
//Here goes my loopy stuff
endwhile;
}
All taken from the codex on WP_Query.
Related Posts:
- How to rename a custom field?
- How can I make wp-pagenavi work on a custom query built upon a form submission? [closed]
- Meta Query with AND & OR?
- Plugin similar to Taxonomy Drill-Down for custom fields?
- How do I query for a post by custom field?
- Count how many posts have a custom field set
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- sort search results by custom fields using dropdown
- How can I sort homepage by a meta value?
- Loop to display random posts only if a custom field matches category
- Conditional custom field query
- Display only past events on that page using Visual Composer Grid Bulider
- Custom Field Create Bulk via SQL Query
- Create Pop-Up Box with Custom Field Content Inside the Loop
- query usermeta from custom field
- Is there any way to get all meta and standard columns for any WordPress object after searching based on meta key and value
- Order RSS content by an advanced custom field value
- Alter main archive, to show posts with meta as last
- Trying to reorder posts by custom field
- Limits, not all post are showen when querying for posts by view count
- Why orderbyb meta_value_num won’t affect the generated SQL Query order?
- Get post ids sorted by meta_key
- querying a custom field
- pre_get_posts : only get posts by wp_usermeta value
- Query post by date (stored custom field meta as yyyymmdd) and differentiate across 12 months
- How to query an out put value?
- List custom queried terms in the edit-tags.php?taxonomy page
- Modify date query by URL parameter using pre_get_posts and $_GET
- Loop through incrementing custom fields
- Custom search SQL Query to add custom field in result
- The best way to collision check in WP
- How to exclude custom fields from search queries?
- How to query for posts with either one or another custom field
- Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?
- Custom Query: query by post custom meta data
- Get array of posts based on custom field values
- Searching with Multiple (Parallel) Criteria on Custom Fields?
- How to query posts by month based on date custom field?
- Custom Field Date Problem
- Compare ACF date field (if exists) and post date and order DESC
- Problem with revisions only returning four results
- Search & column order by meta value in admin
- Dynamically populate query source in Elementor post widget
- searching by keywords in post’s metas or pagination links problem
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Create custom query for search?
- query specific posts according their custom fields, using sql SELECT
- Meta_query not filtering posts
- Get multiple posts with some custom fields efficient
- How to add a prefix to existing custom fields over MYSQL query?
- Complex WP_Query Using Post Date And Post Meta
- How to check if custom field exists in this widget query
- Only show content slideshow if “slideshow” custom field exists
- How to display search query as formatted text?
- Adding a custom field to the site identity menu
- Don’t display html if custom field is empty
- Adding a custom field into the_content()
- Sorting within nested queries / multiple meta keys
- Ordering posts by anniversary using only day and month
- Using a custom field value to redirect away from a 404 page
- How to use pagination with get_post_meta
- Extra filed under “About the user” user profile
- custom field value date convert to unix timestamp problems
- Programatically import custom fields using wp all import [closed]
- How to construct multiple meta boxes
- Redirect users based on custom field
- Order by custom field value not working for acf date field
- How to Validate Post Meta type/extension (Video File Image File etc)
- How can I pass a variable set by ACF to header.php?
- Meta_query is not working on Elementor Custom Query Filter [closed]
- Add Custom Field to a template page backend
- How to schedule a custom field value update?
- Advanced search for meta fields
- Woocommerce Product Custom Select List (not variation)
- How to find a post using XML-RPC without knowing ID
- how to make nsfw post with thumbanil
- Specific coditional usage [closed]
- How to I make my post title link to a custom field
- How can I check if a custom field was updated?
- Get custom fields without _edit_last, _edit_lock, _wp_page_template and _visual-subtitle
- award points to a user each time they update their cpt post
- TinyMCE custom button retrieve value from custom field
- query_posts with meta_value
- Update post meta data (custom field) by post link
- Changing order in which custom fields appear in dashboard
- Let Users Filter Posts by Custom Fields
- Retrieving custom field value with get_post?
- Run Function if Order Meta Exists – WooCommerce
- Custom field outside the loop and inside an array
- Display Additional Info
- Add link to wordpress field data
- Adding text box with add_meta_box
- (woocommerce) How to get product id form order id & then retrieve custom meta linked to product?
- Is it possible to manage Multiple Custom Fields with Some Relations
- RSS Feed in Custom Field
- List custom field values in alphabetical order without repetition from the current category?
- Incorrect data after modifying post using backlink from wp_die
- How can I display only the post titles from a selected category in columns?
- Show or hide custom fields by user’s role [frontend]
- Problem display