Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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
    Simone

    #1228272

    Hey 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,
    Nikko

    #1228317

    Thanks 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
    Simone

    #1228385

    Hi 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,
    Nikko

    #1228783

    Hi 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!
    Simone

    #1229109

    Hi 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,
    Nikko

    #1229205

    Please try again with the same credentials, for some reason the new user was not saved.

    #1229528

    Hi 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,
    Nikko

    #1229671

    Hi Nikko,

    I tried with the plugin now, hope this works!

    Thank you
    Simone

    #1229872

    Hi 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,
    Nikko

    #1230071

    Here you go!

    Big thanks!! :)

    #1230535

    Hi 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,
    Nikko

    #1230578

    Thanks 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!
    Simone

    #1230737

    Hi 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

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.