• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to replace "published date" with "last updated" date

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to replace "published date" with "last updated" date

This topic is: resolved
  • This topic has 16 replies, 3 voices, and was last updated 10 years, 6 months ago by Fabio.
Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • October 12, 2014 at 11:06 am #127584
    Fabio
    Participant

    Hi there,
    the title says it all. I keep updating my posts and it sucks that it shows a published date from 1 year ago or so.
    I want to replace "published date" with "last updated" date so that when I update a post it shows:

    Last updated on October 12th, 2014 by Author

    I was reading this article
    http://www.wpbeginner.com/opinion/why-you-should-not-remove-dates-from-your-wordpress-blog-posts/

    and they say to use this code:
    Last updated on <time datetime="<?php the_modified_time('Y-m-d'); ?>"><?php the_modified_time('F jS, Y'); ?></time>

    but I have no idea where to use it.
    Any idea how to do this?

    Thanks
    Fabio

    ps- my site contains adult content NSFW (no porn, no nudity, just adult topics)

    http://goo.gl/C3pfEA
    October 12, 2014 at 11:35 am #127585
    Brad Dalton
    Participant

    Try this http://wpsites.net/wordpress-admin/last-modified-date-shortcode-for-genesis-post-info/


    Tutorials for StudioPress Themes.

    October 13, 2014 at 7:25 am #127668
    Fabio
    Participant

    Hi Brad,
    I have copied both raw codes at the bottom of my functions.php file (I have tried on a test site first and not on the real one) and nothing happened. It did not show "last updated" at the top of the post.

    What's going on?
    Thanks
    Fabio

    October 13, 2014 at 1:08 pm #127684
    Fabio
    Participant

    Eleven 40 doesn't even display the words "published" usually. I have actually found other people on forums asking for help with this problem on Eleven 40 (I am using the old eleven 40, not the PRO one).
    Any help please?

    October 13, 2014 at 11:13 pm #127717
    Brad Dalton
    Participant

    Won't work if you use both code snippets.

    Please only choose one method.

    You will need to update the posts as well for the updated ( modified date ) to display.

    All code snippets on my site are tested and work.

    If it doesn't work for you then the problem is most likely at your end.

    Some work is required on your behalf.


    Tutorials for StudioPress Themes.

    October 14, 2014 at 10:28 am #127786
    Brad Dalton
    Participant

    Fabio

    Just tested the code and it works.

    Here's the screen cast which may help http://www.youtube.com/watch?v=JjMEwtlSfB8

    There's 2 steps required.

    1st is to create the shortcode and the 2nd is to filter the post info and add the new shortcode so 2 snippets need to be pasted.


    Tutorials for StudioPress Themes.

    October 14, 2014 at 11:38 am #127790
    Fabio
    Participant

    HI Brad,
    thanks for the video. I have pasted this code:

    add_filter( 'genesis_post_info', 'add_modified_date_post_info' );
    function add_modified_date_post_info($post_info) {
    	$post_info = 'Updated: [modified_date] by [post_author_posts_link] [post_comments] [post_edit]';
    	return $post_info;
    }
    
    function wordpress_modified_date_shortcode() {
    
        return get_the_modified_date(); 
    }
    add_shortcode( 'modified_date', 'wordpress_modified_date_shortcode' );

    at the bottom of my functions.php

    I have updated the post, deleted the cache and hard-refreshed the page, but it's not working.
    Maybe it only works on HTML5 themes and not on the old ones?

    Thanks

    October 14, 2014 at 11:42 am #127791
    Sridhar Katakam
    Participant

    Try http://sridharkatakam.com/add-last-updated-date-post-info-genesis/


    Genesis Tutorials | Follow me on Twitter

    October 14, 2014 at 12:25 pm #127798
    Brad Dalton
    Participant

    Didn't test on the old themes running XHTML but you could be right.

    Try the old code and see if it works with the shortcode http://my.studiopress.com/snippets/post-info/


    Tutorials for StudioPress Themes.

    October 15, 2014 at 3:00 pm #127919
    Fabio
    Participant

    @Sridhar
    I have tried with that code on a website using News PRO and it didn't work.
    Actually I have noticed you are using Eleven 40 on your website, so have you tried it there? Does it work?
    I am using an old version of Eleven 40 - the one before the HTML5 update


    @Brad

    Sorry Brad what do you mean by:
    Try the old code and see if it works with the shortcode http://my.studiopress.com/snippets/post-info/

    How do I need to edit/adapt that shortcode?

    I have installed the same Eleven 40 on a test site. If you want I can post the credentials here and you can log in and see what's going on...

    Thanks

    October 15, 2014 at 10:41 pm #127954
    Brad Dalton
    Participant

    I'm happy to login and fix the problem for you for a fee.

    If you want this done, please send me your login details and i'll work out what the problem is.


    Tutorials for StudioPress Themes.

    October 16, 2014 at 3:16 pm #128053
    Fabio
    Participant

    Hi Brad,
    should I contact you through your site to have a quote?

    October 16, 2014 at 3:28 pm #128055
    Sridhar Katakam
    Participant

    Fabio, I do not have a copy of eleven40 (XHTML) theme to test.

    I tested the code in http://www.studiopress.community/topic/how-to-replace-published-date-with-last-updated-date/#post-127790 in News Pro and Balance, a XHTML theme and it is working fine in both of them.


    Genesis Tutorials | Follow me on Twitter

    October 16, 2014 at 4:33 pm #128057
    Fabio
    Participant

    Hi Sridhar,
    that's strange now it seems to work on my test site too.
    I will try on the blog and see what happens.

    October 20, 2014 at 6:14 pm #128516
    Fabio
    Participant

    Ok super super weird:

    It works on my test site:
    http://testing.exclusiveskills.com/

    it doesn't work on my blog:
    http://goo.gl/C3pfEA

    both test site and blog have the same Eleven 40 version and same identical functions.php file.

    Any idea where I should look for the issue?

    October 24, 2014 at 6:09 pm #129018
    Fabio
    Participant

    I have copied
    functions.php
    home.php
    and style.css
    from my blog to the test site, so now the two sites have identical code, identical wordpress version and genesis version. And yet the test site shows the "last updated" and the blog doesn't.

    Is it possible that a plugin is interfering? I have some plugins installed on my blog which I don't have on the test site.
    Is that a possible way to go to find the solution?

    October 26, 2014 at 3:04 pm #129315
    Fabio
    Participant

    The problem is the "Genesis Simple Edits" plugin.

    When I deactivated it, the "last updated" thing appeared.

    Then I replaced this:
    Last Updated: [modified_date] by [post_author_posts_link] [post_comments] [post_edit]

    in the post info section of the simple edits plugin and now it works 🙂

  • Author
    Posts
Viewing 17 posts - 1 through 17 (of 17 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble