You shouldn’t need to use a meta field for this logic.
In the loop $post->post_date
holds when the post is published. From there you can determine if the date is 90 days old:
$datetime = strtotime($post->post_date);
if( $datetime < ( time() - ( 60 * 60 * 24 * 90 ) ) ) {
echo "> 90 days old"
} else {
echo "< 90 days old"
}
Related Posts:
- Adding fields to the “Add New User” screen in the dashboard
- Displaying the number of updates available in the Admin area
- What’s the difference between admin_url() and get_admin_url() functions?
- How to influence the information displayed on widget inside wp-admin
- How to override admin-bar style
- TinyMCE custom styles remove class when switching styles
- Auto close (hide) custom metabox / set default state
- Show modified time if post is actually modified
- How do I create a new WP admin color scheme?
- AJAX handler throws 400 (Bad request) – why?
- wp-admin page is blank
- change the comment time output to: X time ago instead of actual date and time
- Replacing select2 in admin backend for all selects
- difference between add_object_page and add_menu_page
- How to fix a theme with page.php Default Template that accidentally deleted?
- How to activate “Description” metabox for menu item programmatically?
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Displaying Saved Meta Box Data in Drop Down with selected()
- How can I rename the WordPress AJAX URL? [duplicate]
- radio button is checked but display not check
- How to add a column to the Trash page?
- Comments to only be seen by their author
- How to change menu icon which is overriden (i.e. by WooCommerce) [closed]
- Custom roles can’t access to wp-admin
- password protected post policy
- How to hide, and not to remove the attributes metabox?
- Removing the main link to Jetpack from the menu
- Access / Filter block variations in Gutenberg, in WordPress 5.6
- How to remove howdy dropdown menu content
- get_post_type() in in_array doesn’t work for some reason
- “is_new_day()” alternative for years?
- How to hide a plugin metabox for non admins when a user adds a new post
- Add Featured image column into wordpress admin on pages AND posts
- Selective Product Category for Carousel
- How to force field validation first, then its values saved durning edit profile?
- Move ‘current-menu-item’ class on #adminmenu li from Posts to Pages for Taxonomy Edit Screen
- How to auto refresh when user change postcode
- Sections and tabs DRY – WordPress settings API
- How to install Segment on WordPress without a plugin
- Custom Attachment Caption Fields
- Get First Child Page ID or Permalink in WordPress Admin
- Creating A New Admin Menu Tab For Theme Options
- wp-admin won’t load after setting wp-login custom url
- Wp admin – Set default value to 999 in comments
- Remove “Published On” inside wp-admin
- Where do i create my own function in wp-admin
- WP function won’t work on 404 template page
- How to remove comment count column in Posts inside the admin dashboard?
- What is the text that appears beside the page titles in the list of pages in the WP admin?
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- Use a shortcode to display custom meta box contents
- Sortable column (by numbers) in admin users
- Compare meta key to current date in pre get post
- error at login page in wordpress
- Update to functions.php not showing in dashboard
- Add element to widgetpage
- Best way to disable sidebars on posts (only)?
- “options.php” not found
- How to change a specific admin label
- wordpress built-in Jalali date convertor
- sort metabox columns in listing Single
- How to avoid saving empty data to sql while using add_meta_box
- Save Meta when custom Taxonomy Saves
- Block all plug-ins from initiating redirection upon activation?
- How to add custom metakey to shop_order page’s searching function?
- Render metabox gallery in frontend
- Unable to login after registration
- Insert Modal on user first login
- Creating a “Related Meta” type field?
- WP Enqueue Script Error
- DISABLE wordpress upgrade page
- admin-ajax.php & my wp-admin folder url showing in header
- What is wrong with functions.php? Fills error log with same error
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Meta Box value not been pulled in
- Decimal stripped from metabox number
- Changed functions.php file and now site is blank [closed]
- Setcookie not setting cookies anywhere except admin
- Second featured image only shows in metabox preview after saving a post in the wordpress editor
- install Segment on WordPress
- Missing feature image link function
- What’s the difference between home_url() and site_url()
- Remove “Category:”, “Tag:”, “Author:” from the_archive_title
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- Changing Admin Menu Labels
- remove empty paragraphs from the_content?
- What is the “with_front” rewrite key?
- Why use if function_exists?
- How to override parent functions in child themes?
- wp_enqueue_script was called incorrectly
- Add multiple custom fields to the general settings page
- Ajax call always returns 0
- 400 bad request on admin-ajax.php only using wp_enqueue_scripts action hook
- How long does a deprecated function live in core?
- Solution to render Shortcodes in Admin Editor
- How to add a data attribute to a WordPress menu item
- What’s the difference between esc_html, esc_attr, esc_html_e, and so on?
- remove_action on after_setup_theme not working from child theme
- plugins_url vs plugin_dir_url