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]
- If Custom Field is empty don’t display div
- Archive listing of posts by publish year (multiple years)
- The values of custom fields are not available functions.php
- WordPress returns a wrong date
- Unique key for each row in a repeater field
- Advanced Custom Fields Image Field returning ID instead of URL [closed]
- 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
- 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
- Using Advanced Custom Fields to create a per page slider
- 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)?
- Adding number to date not working [closed]
- Set meta field to publish date + 2 weeks
- 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
- Sort by page information by Ascending Numbers
- 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”?
- Upload non-featured image to image field
- 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
- InnerBlocks with allowedBlocks not working with acf_register_block
- Accessing values from ACF sub field (flexible content area) in PHP
- Creating an image from a custom field
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Get ACF options field in PHP acting as CSS
- ACF & Bootstrap Gallery Shows Blank Slides [closed]
- 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]
- Get All In One SEO Pack to use custom field instead of Content
- Display Post Title From Select Choice Loop in Advanced Custom Fields (ACF) – WordPress
- Add class to all img if they have a certain ACF field
- Foreach loop is unexpectedly outputting an extra empty a tag
- How to store checkbox data for individual users?
- Problems updating nested ACF field groups
- Get main parent category for post (WordPress/Advanced Custom Fields)
- Bootstrap 4 Carosuel with ACF Repeater field
- Issue in displaying the ongoing event and current events in the post
- Set ACF on order during checkout
- If Statement is Ignored?
- Query on a repeater date (acf)
- ACF values to Script with auto refresh
- ACF – Can’t get custom post type by taxonomy
- 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 under category name in shop page [closed]
- get_template_part() not working with Advanced Custom Fields plugin
- List all ACF field values across every post on one page
- 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
- Make sticky post with FacetWP
- WordPress change post date format from english to japanese
- WooCommerce Custom Tab with ACF Repeater Field
- PHP for loop not working as intended
- Position a repeated article blocks
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- Display a single row from nested array of custom field data
- Adding a number to a date
- Else if Statement for Advanced Custom Fields [closed]
- Display Year and Month from custom field + Age Calculator
- Get month and day from a Date Picker custom field
- get_category only returning details for ‘uncategorized’
- 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
- Show button in header when product custom field is not empty
- 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”
- 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]
- Cannot Access ACF Field Values via my Plugin
- How to create advanced custom fields for backend content
- Add up all numbers from a WordPress query [closed]
- Why does my custom slug only show in Gutenberg editor after page refresh?