Editing the theme is a good way to get this done, if it’s a theme with updates from someone else I would make a child theme to prevent your changes being overwritten:
https://developer.wordpress.org/themes/advanced-topics/child-themes/
Another option is to make a plugin that utilizes a shortcode that allows any WordPress editor to just plug that shortcode into the WordPress page editor. There might be a plugin that already does this, search?
Wherever you need the date changed you could add this code in replacement:
<?php
$acfCustomDate = strtotime(get_field('custom_date'));
$currentDate = strtotime(getdate());
$secsAgo = $currentDate - $acfCustomDate;// == strtotime gives seconds
$daysAgo = $secsAgo / 86400;
if($daysAgo > 0)
echo "Posted $daysAgo days ago";
else
echo "Posted $daysAgo days in the future!";
Related Posts:
- Display all values of custom a field created with ACF on a page
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Conditional statement for parent, child and grandchild pages
- Problem with ACF shortcode with Repeater Field in WordPress? [closed]
- How to Explode a Textarea Field and Echo each line separately, wrapped with HTML
- Advanced Custom Fields Image Field returning ID instead of URL [closed]
- Unable to set right time in admin and frontend template
- WP_Query meta_query results date by date
- Can an array be used as a meta_query value?
- Way to display “Yesterday”, “Today”
- ACF check if variable has http, if else return string
- Advanced Custom Fields: Post Object – Not returning data [closed]
- ACF: Only get first row of a Repeater Field
- Importing hard coded custom field into acf field
- display month in french in wordpress/php?
- Strip characters, Including spaces, for tel: link
- How can I add multiple ‘tax_query’ arrays via a loop?
- ACF page while loop breaks footer while loop
- Change output based on text field value
- Get date numerical and separate?
- ACF: how do I get the fields and its values of a specific group?
- Saving an array of dynamic repeater data as post_meta
- Output ACF repeater on frontend user’s profile page (created with Ultimate Member) [closed]
- Remove the first 5 characters of the_title and orderby that
- Print last modified date only on posts
- Unread Repeater field IMG alt not working
- Slick + PHP + ACF + JQuery slide reveal not working
- How to manually change current date to post date in frontend?
- Advanced Custom Fields not displaying
- Converting Y-m-d to a date with a Month name? [closed]
- Download PDF after CF7 form submission
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- How would I use this filter to change the output of the date format to “Twitter time”?
- How to get User Time Zone in WordPress?
- ACF put a comma after the last repeater field value [closed]
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Form search query – displaying ACF “Post Object” field as results
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Get ACF options field in PHP acting as CSS
- Conditional multidimensional arrays and array_map
- How can I count ACF sub_field with a certain value
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Advanced Custom Fields [closed]
- ACF Unexpected T_CONSTANT_ENCAPSED_STRING [closed]
- Including Custom fields within the_content
- Get All In One SEO Pack to use custom field instead of Content
- Get date function not working
- Update user repeater meta (ACF) with another user meta field value
- Foreach loop is unexpectedly outputting an extra empty a tag
- How to store checkbox data for individual users?
- Problems updating nested ACF field groups
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Get main parent category for post (WordPress/Advanced Custom Fields)
- Issue in displaying the ongoing event and current events in the post
- ACF Taxonomy field values not select in backend
- Set ACF on order during checkout
- If Statement is Ignored?
- Use WPQuery to match to specific repeater row in post
- Query on a repeater date (acf)
- ACF values to Script with auto refresh
- ACF – Can’t get custom post type by taxonomy
- Advance custom fields variable with if statement & Function
- ElseIf Statement with ACF Group field
- Advanced Custom Forms PHP formatting for do_shortcode
- Get posts from year from URL
- Get field value and use as variable in php
- ACF Gallery field images donwload
- ACF – Get ID of relationship field in flexible content
- ACF under category name in shop page [closed]
- Get list of posts from attachment
- Pulling Products from an API
- Primary navigation menu with timed items from custom post type
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Can’t add to time? [closed]
- ACF background-color per post in a WordPress loop
- How can I copy an ACF field to AIOSEO field? [closed]
- Grouping posts by date
- Scheduling a post using publish date from a custom field. Resulting post is set as published in the future instead of scheduled
- Make sticky post with FacetWP
- WordPress change post date format from english to japanese
- PHP for loop not working as intended
- Position a repeated article blocks
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- Adding a number to a date
- Else if Statement for Advanced Custom Fields [closed]
- ACF Images If/else
- Display Year and Month from custom field + Age Calculator
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Get month and day from a Date Picker custom field
- the_post_thumbnail unless video id is added
- get_category only returning details for ‘uncategorized’
- Add comma between variables [closed]
- ACF Date fileds to Age Convert [closed]
- Advanced custom fields Repeater conditional statement not working [closed]
- Order woo products, but first products must be with acf fields
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- advanced custom fields: repeater field within conditional statement [closed]
- Convert custom field date format to “WordPress default”
- ACF number less than comparison not working