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:
- Date not working correctly
- Calculate business days
- the_date() not working
- Display all values of custom a field created with ACF on a page
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- If Custom Field is empty don’t display div
- Archive listing of posts by publish year (multiple years)
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Conditional statement for parent, child and grandchild pages
- The values of custom fields are not available functions.php
- WordPress returns a wrong date
- Problem with ACF shortcode with Repeater Field in WordPress? [closed]
- Unique key for each row in a repeater field
- 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]
- Looking for most performant way to execute several similar WP queries within shortcodes
- ACF: Only get first row of a Repeater Field
- Trouble With Conditional Logic in PHP
- 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
- Using Advanced Custom Fields to create a per page slider
- Get date numerical and separate?
- Display PHP within HTML values
- ACF: how do I get the fields and its values of a specific group?
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- 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
- Adding number to date not working [closed]
- Set meta field to publish date + 2 weeks
- Unread Repeater field IMG alt not working
- Unable to write multiple values back to ACF user field – PHP
- Update grandchild repeater field with value per row
- How to use thumbnail size of image if I’m only using src to get image
- Slick + PHP + ACF + JQuery slide reveal not working
- How to manually change current date to post date in frontend?
- Sort by page information by Ascending Numbers
- Advanced Custom Fields – display label and value only if value entered
- Advanced Custom Fields not displaying
- Convert WordPress date format to jQuery UI Datepicker format
- 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”?
- Upload non-featured image to image field
- How to get User Time Zone in WordPress?
- HTML Special Characters in URL string [closed]
- 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
- Sort by multiple options in custom field
- If or/and statement advanced custom fields [closed]
- Top menu disapears in Category Pages when filtering using ACF
- ACF loop and php formatting
- the_post_thumbnail unless video id is added
- get_category only returning details for ‘uncategorized’
- Custom field within shortcode
- ACF allow zero as a value
- 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?
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Show button in header when product custom field is not empty
- advanced custom fields: repeater field within conditional statement [closed]
- How can I get values from a custom post type depending on where I click on my SVG map?
- Convert custom field date format to “WordPress default”
- Creating posts with php-script + csv
- ACF number less than comparison not working
- Advanced Custom Fields – How do I get field values of a group within a group field type
- How to change post date and post time in WordPress automatically with a function
- “acf/load_field” Critical error upon saving/updating WooCommerce products [closed]
- How to get ACF field to show up on all posts on front end?
- Put ACF function output code the_terms
- Cannot Access ACF Field Values via my Plugin
- Advanced Custom Fields Auto Populating Field Values For Nested Repeater FIelds
- How to create advanced custom fields for backend content
- Phone number custom field and woocommerce updating issue noticed
- How to capture number input from wordpress form into acf field in woocommerce
- add class to woocommerce single product template gallery thumbnails if media attachment ACF field toggled (true/false)
- Alter main query to always list posts according to ACF number field
- Add css class ID to largest and smallest number a custom field in wp_query
- create custom post type and populate custom fields using php
- Add up all numbers from a WordPress query [closed]
- WordPress per ACF – permalink is not working
- Why does my custom slug only show in Gutenberg editor after page refresh?
- Display posts in correct month order using single date custom field