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
- In a WordPress plugin, how do you output HTML code inside the DOM header? [closed]
- Get page slug and assign a variable within functions.php
- How to insert a text in all pages and posts before or after specific places?
- Change Admin Bar “Visit Site” URL
- exclude a category from a search on a specific page
- Last updated date function
- Possible to display shortcode based on the category?
- How to set default archive image without overriding first attached image? [closed]
- Passing a variable via wp_head and then calling it on the page
- How to know which ajax file or function is called for action
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- Parent theme styles overriding child theme CSS [closed]
- Multiple, Dynamic, Sidebars Problem – First Sidebar not working properly
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- How to Override Page Template if URL matches query?
- Database Query not working
- How to use WP_rewrite?
- Wp get archive only text not link
- can not call functions in function.php
- What are the parameters are used in add_action and filters?
- Load script only on selected Pages
- Convert Image to Webp on upload without plugin