Try the custom field parameters for WP_Query
$cf_query = new WP_Query( array (
'order' => 'DESC',
'meta_query' => array(
array( 'key' = > '_flatme_key')
)
));
Assumes _flatme_key is your custom field key
Related Posts:
- WordPress function like is_category for subcategory? is_subcategory?
- deregister scripts on certain page
- is_front_page not working in functions.php
- disable comments if array exists
- Problem using is_single() to enqueue script from functions.php
- Conditional tag is_page with a custom post type
- Limit posts only on home page – ideally in functions.php
- Enqueue scripts not working with if is page conditional tag in functions.php
- Conditional read more adjustment
- How add various functions within 1 conditional?
- Conditional Gravity Forms filter in WordPress Multisite
- Has is_archived() for sites in a multisite changed with WP 4.7?
- Testing for a shortcode using a function. 404 page throwing PHP Notice
- is_page() or is_single not working
- functions.php and conditional tags
- issue with if/elseif in_array inside foreach loop display only one post
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- Entirely Different Functions.php per Page?
- Function to echo (or display?) wordpress tags in the head section
- is_home() not working in functions.php file
- If is_single in functions.php
- Enqueue script if not page template
- is_product_category(‘Services’) not working
- method to fetch entire tag list on archive.php
- Adding an IF ELSE to a function
- how to display featured image for single post for a specific category
- admin-ajax.php nulls all php variables
- restrict access to specific urls on a specific period of time
- Change conditional tag in wordpress without editing the core files
- wp_enqueue_scripts called twice?
- How can i hide content if not friend in Buddypress? [closed]
- PHP Notice: Function is_page was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false
- What is the “with_front” rewrite key?
- Filter the query ONLY for the search results page
- How to add attributes to a shortcode
- Delete expired posts after a number of days after they expired
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- How to override functions.php in child theme?
- Is it possible to maintain image aspect ratio when scaling images?
- How to override WordPress registration and insert an auto-generated username?
- How often is functions.php loaded?
- update_post_meta for custom field not working upon form submission
- how to get and display logged in user’s recently read posts
- Cleaner way to access custom fields in code?
- Add a new subscriber role using a function
- Why functions.php file is called 8 time for just one page load?
- How to set the jpg image compression for specific thumbnail sizes?
- Function to auto-set a featured image that is already in use
- Delete pages and Create default pages for all new network sites
- Post thumbnail relative link and HTML modify
- Find first image on paginated post for Pinterest
- How would go about if I just want a temporary function?
- How do I edit wp_head and/or functions.php to remove rss-feed which isnt used and dont validate?
- Generating rel=prev and rel=next only on wordpress categories
- How do I get a child theme to load scripts from the parent theme?
- Access / Filter block variations in Gutenberg, in WordPress 5.6
- example of build_query function?
- Avoid loading css from parent theme
- How to hide unused profile fields?
- async javascript and css for wordpress
- Override widget in function WordPress
- WooCommerce – Want to show multiple currency for a single product [closed]
- How to change or add user role after getting post request data about pay? [closed]
- Disable auto-resizing of uploaded images, but only for certain filename
- Add to cart php not working [closed]
- Create cron job for update translations automatically
- Login Redirect if Logged in from Specific Page
- Automatically include all php files in a child theme directory
- Override the function twentytwelve_scripts_styles in a child theme
- Custom taxonomy widget in admin area
- Removing specific menu items?
- What is the Difference in bones_comments() and comments.php
- AJAX error handling for submit function in functions file
- Do I need to use wp_reset_postdata for my function?
- Split Media Queries in different files!
- Use a shortcode to display custom meta box contents
- how to make has_block() see inside blocks too
- add_theme_support( ‘title_tag’ ) is not showing title on index.php
- Tracking the number of shortcodes for a list?
- Solution dealing with Child Theme / Parent theme functions
- Function to pull data from user meta not working
- remove edit link only for published post and pending post
- When are the user meta fields created in the database? Admin vs Woo API REST
- How to automatically add counted number to navigation menu items?
- Replace theme function
- How to access custom class methods from any include without using global
- Insert Modal on user first login
- What is best practices to move the following code into a function?
- Correct way of Enqueue self hosted fonts in sass project
- function syntax is off,
- Change category checkbox into radio button [duplicate]
- wp_enqueue_script only works outside of action
- How can I include user meta information in the resulting array of a WP_User_Query?
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- jQuery HoverIntent is not a function
- Dynamic Title for custom post types
- Use $_POST[‘value’] inside functions.php
- shortcode inside post called by ID does not render as expected
- get_footer can’t find any variables set in functions.php
- How to hook wp_mail to add a custom email as BCC for each sent email?