Tagged: last modified date
-
AuthorPosts
-
July 6, 2020 at 7:37 am #1228195
Hi there!
I’d like to display the last modified date instead of the publication date, as a standard.
I saw there was a couple of old topics related to similar question but had no luck with trying that.
Any hint?
Thanks a lot
SimoneJuly 6, 2020 at 12:55 pm #1228272Hey Simone,
Have you tried this code:
add_filter('avf_template_builder_content', 'add_modified_date', 10, 1); function add_modified_date($content = "") { $content .= "<div class='modified'>Last modified: ".get_the_modified_date('F j, Y')." at ".get_the_modified_date('g:i a')."</div>"; return $content; }
If that doesn’t work, can you give us a link to the page? so we can guess what setting you’re using.
Best regards,
NikkoJuly 6, 2020 at 4:24 pm #1228317Thanks Nikko!
Where should I paste it?
The website is in maintenance mode at the moment so unfortunately I am not able to let you see the blog page.
Thanks a lot
SimoneJuly 6, 2020 at 10:48 pm #1228385Hi Simone,
You can put it in your child theme’s functions.php.
If don’t have a child theme yet, you can download it and find instructions here: https://kriesi.at/documentation/enfold/child-theme/
As for the link, maybe you can give us temporary access so we can see it.
Just post the credentials in Private Content, so it’s only you and the moderators that can view it.Best regards,
NikkoJuly 8, 2020 at 8:00 am #1228783Hi Nikko,
I tried to paste it without success, I am not sure if it is actually the functions.php of the child theme or the general one. It is just called functions.php.
Now I removed it.
Link below in the private section. Thanks a lot!
SimoneJuly 9, 2020 at 11:20 am #1229109Hi Simone,
I tried to access using the temporary access you gave however I’m getting this when trying to login:
ERROR: Incorrect Username or Password
Please check.
Best regards,
NikkoJuly 9, 2020 at 4:09 pm #1229205Please try again with the same credentials, for some reason the new user was not saved.
July 11, 2020 at 4:57 am #1229528Hi SimonePols,
It’s still the same, see screenshot in private content.
I have tried copying and pasting and typing it manually but it didn’t work.Best regards,
NikkoJuly 11, 2020 at 5:39 pm #1229671Hi Nikko,
I tried with the plugin now, hope this works!
Thank you
SimoneJuly 13, 2020 at 8:55 am #1229872Hi Simone,
I have tried 3 attempts and it didn’t work.
It seems like the username is correct since I tried the lost password and it accepted the username.
The password seems to be wrong. (I tried removing thanks or -thanks, also didn’t work)Best regards,
NikkoJuly 13, 2020 at 7:13 pm #1230071Here you go!
Big thanks!! :)
July 15, 2020 at 9:22 am #1230535Hi SimonePols,
Thanks for giving us admin access.
There is one requirement before we do the modification and that is using a child theme (so any modifications made will not be lost during theme update), you can download the child theme and find instructions on how to use it in our documentation: https://kriesi.at/documentation/enfold/child-theme/After child theme has been setup, you will need to add this code in functions.php of the child theme: (this only works for Masonry)
function enfold_masonry_loop_prepare($key, $entries) { $modified_date = get_the_modified_date( 'F j, Y', $key['ID'] ); $key['date'] = "<span class='av-masonry-date meta-color updated'>" . $modified_date . "</span>"; $key['text_after'] = $modified_date; return $key; } add_filter('avf_masonry_loop_prepare', 'enfold_masonry_loop_prepare', 10, 2);
Best regards,
NikkoJuly 15, 2020 at 12:25 pm #1230578Thanks Nikko!
I installed everything as per documentation now and that worked on the general blog page, but when I open an article the date inside the article is still the old one (I’d send you a screenshot but not sure how to upload files here).
Thank you!
SimoneJuly 15, 2020 at 9:28 pm #1230737Hi SimonePols,
You can upload screenshots to a service like Dropbox or http://imgur.com and give us the links here.
The code above is changing the date in the masonry only. You need different code to change the date there.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.