Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #325220

    Hi there,

    I’ve got a question about displaying a “Last modified on: ” date.

    Is there a possibility to display an last modified on date somewhere on a single page?

    Is there a possibility to display an last modified on date for the whole site somewhere on every page?

    Kind regards, eagerly wainting for 3.0 :).

    #325428

    Hi m00n!

    Thank you for using Enfold.

    You can edit includes > loop-index.php. Add the the_modified_date function. Please refer to this link: http://codex.wordpress.org/Function_Reference/the_modified_date

    Best regards,
    Ismael

    #325492

    Hi there,

    Thanks for the response. I tried the following code:

    <?php
    echo "<div><p>Last modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?></p></div>";
    ?>

    I added it in loop-index.php but it shows up nowhere.

    When i add it to footer.php. It only shows “Last Modified at .

    #325502
    This reply has been marked as private.
    #325660

    Hi!

    Make sure to read the whole codex entry. It would not work in the footer because it isn’t in the loop. Otherwise add it to a variable (the values you want) then echo out those variables where needed.

    Cheers!
    Devin

    #326391

    Hi there,

    Thanks for the responses. I can’t get it to work. Any further suggestions?

    Greatly appreciated!

    #326969

    Hey!

    There is no way to make it work in the footer:

    This tag must be used within The Loop

    http://codex.wordpress.org/Function_Reference/the_modified_date

    Cheers!
    Josue

    #327112

    Hi there,

    I understand, but is there anyway to get it to work? I tried placing it in the loop, but i can’t get it to show up anywhere.

    #327398

    Hi,

    Open includes/loop-index.php and look for this:

                        echo '<span class="blog-author minor-meta">'.__('by','avia_framework')." ";
                        echo '<span class="entry-author-link" '.avia_markup_helper(array('context' => 'author_name','echo'=>false)).'>';
                        echo '<span class="vcard author"><span class="fn">';
                        the_author_posts_link();
                        echo '</span></span>';
                        echo '</span>';
                        echo '</span>';

    Add this line below:

                       echo "<span class='text-sep text-sep-cat'>/</span><span class='minor'>Last modified: ".get_the_modified_date('F j, Y')." at ".get_the_modified_date('g:i a')."</span>";
    

    Regards,
    Josue

    #327501

    Hi Joshue, Thanks for your response.

    Added the line, but nothing shows up.

    Site consists of pages build with the page builder. I need the last modified date showing on every page. I’m not using a blog or portfolio feature. If possible showing the modified date on the bottom. (no footer/socket active).

    #327537

    Hey!

    Can you post a link to your blog?

    Best regards,
    Josue

    #327540
    This reply has been marked as private.
    #327570

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    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;
    }

    Cheers!
    Josue

    #327609

    Hi there,

    Thanks Joshue, we are getting there. Modified date is finally showing. Anyway to get it (floating)outside the main content? Floating to the left of browser window.

    I’m trying to get it to work with CSS but it won’t budge :).

    • This reply was modified 10 years, 1 month ago by m00n.
    #327655

    Hi!

    This could work, use this code instead:

    add_action('wp_footer', 'add_modified_date', 10);
    function add_modified_date()
    {
    	echo "<div class='modified'>Last modified: ".get_the_modified_date('F j, Y')." at ".get_the_modified_date('g:i a')."</div>";
    }
    

    Best regards,
    Josue

    #327665

    Thanks Joshue, that did the trick!

    Awesome support!

    #327668

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 17 posts - 1 through 17 (of 17 total)
  • The topic ‘DIsplaying last modified date’ is closed to new replies.