Why not pull the post you need, rather than pull a post and then check the value of the meta key?
$now = strtotime(date('d-m-Y H:i:s')); // get current timestamp
$args = array(
'post_type' => 'presenter',
'posts_per_page' => '1',
'order' => 'DESC',
'meta_query' => array(
array(
'key' => 'on_air',
'value' => $now,
'compare' => '>=',
),
),
);
Related Posts:
- Copying Custom Meta Values from existing post to a duplicate post
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- ACF: How to get the full field name (meta_key) by a field key?
- Get all the posts where meta field with multiple choice has several values checked
- WordPress creates new lines in postmeta table on post update
- How to get custom image field of specific post id
- save all acf options in one meta_value [closed]
- Can I exclude a post by meta key using pre_get_posts function?
- What is the index [0] for on post meta fields?
- Custom field metabox not showing in back-end
- How to hide meta box values from custom fields list?
- What is the advantage of the wp_options design pattern?
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- Transients vs CRON +Custom Fields: Caching Data Per Post
- Unable to save datetime custom meta field using update_post_meta() function
- Create custom field on post draft or publish?
- Display info from custom fields in all images’ HTML
- get_post_meta fields don’t show up on posts page
- Update meta values with AJAX
- copy attachments to another post type and change attachment url
- Cannot edit post meta fields with rest API
- Add a post meta key and value only if it does not exist on the post
- Custom fields to save multiple values
- Function to change meta value in database for each post
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Get aggregate list of all custom fields for entire blog
- Login & Register & Custom details WITHOUT plugin
- Send Multiple Custom Field Values Through the URL
- wp_handle_upload error “Specified file failed upload test” but still creates attachment?
- using multiple meta_key and meta_value in query_posts
- Update posts after populating ACF field value [closed]
- Adding custom fields (post meta) before/during wp_insert_post()
- MySQL Query that looks for post with Custom Field, then changes Category
- Will loading too many ACF Fields cause slow down?
- post meta getting deleted on save
- How to add a new meta key and assign timestamp to posts
- Custom field not updating when value is empty
- meta_compare seems to be treating values as strings instead of integers as expected
- Calling the “wp-link-wrap” pop-up modal
- Print custom field in Query Loop block
- Limit the number of acf content when displaying in post loop [closed]
- How to add custom metadata text box dropdown to sidebar in Gutenberg editor for all post types
- Order RSS content by an advanced custom field value
- How to create a dropdown select of all items in an ACF field group
- Displaying multiple URLs as custom field values
- Show values of custom post meta on ‘Add new post’ page?
- Sort custom post type by multiple custom fields
- Custom post meta field effect on the performance on the post
- Limits, not all post are showen when querying for posts by view count
- Display Custom Meta Box Field Only If Value is Present
- Stop sending email everytime I updates my post
- Best way to store everyday post views?
- Advanced Custom Fields WYSIWYG More tag
- Unable to get specific value from post meta
- Custom meta is not being saved
- IF Custom field value equals ZERO
- How to use media upload on metabox post page without breaking TinyMCE?
- Branch made by several custom values
- Looping inside block return
- How to copy data from a custom field to the post_content?
- User customising position of WordPress Featured Image
- Can I save post meta programatically without setting metaboxes?
- Insert image into sub-field with update_post_meta
- How to Pass values to Custom Field through PHP in WordPress Posts?
- How to use conditional statement with custom field
- Advanced Custom fields not available yet during publish_page action
- Meta box values are displayed on Custom Fields list. Is it possible to hide them?
- Best way to achieve multiple links in a post title
- How can I add/update post meta in a admin menu page?
- Get author total post votes from post meta
- custom filed from post in the side bar
- Rewrite comment form post ID on submit
- What am I missing in this Code Block?
- How to show ACF fields in Gridbuilder custom block
- How to display custom fields in hestia theme
- Shortcode for Custom Field of Media Attachment (to use with Featured Images)
- How to speed up post list slowed by update_meta_cache()?
- WordPress Blocks, setAttributes not saving
- SQL query to change the value of a Custom Field
- Custom meta POST request fired twice when updating a post in Gutenberg
- Retrive acf fields in publish_post action for wp_mail
- Add custom field information to source meta data
- Update custom field on page specific to logged in user
- Create Meta boxes dynamically
- How to delete attachments associated with custom field type when post property changes? [closed]
- Page template is missing fields or is invalid when I updating the template
- Delete custom meta
- Problem saving meta data
- Check if value exists before saving
- Get meta value when the page is a blog archive
- display Flexible Fields from options
- change attachment custom field onChange event
- How to filter post using custom feild value in shortest and longest duration?
- Query Posts Via WordPress URL
- wp_postmeta are updated for only one page
- Get custom field from other post in carousel
- I want to add a custom field in the rss title of each post, but don’t want it to be shown on the site
- Make Custom Fields Public in JSON – API
- Advenced custom fields auto fill problem
- Site uses wpdb to fetch meta_keys but just displays first meta_key from a page (the post uses the same meta_key “filmmaker” more than once)