• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Add Last Updated Date To Post Info In Genesis

This code removes the published date and displays the last time you clicked update for the post.

Add the PHP code to the end of your child themes functions.php file using a code editor like Notepad++.

That’s all you need to do.

The updated date is now included in genesis > lib > shortcodes > post.php.

Other Options

  • Add How Long Ago A Post Was Published To Genesis Post Info
  • 3 Ways To Manually Update Genesis Post Date With The Modified Date On Individual Posts
  • 4 Ways To Remove, Hide or Customize Post Info Links in Genesis
  • 3 Ways To Remove Post Meta & Post Info Links
  • How To Add Post Info To Pages

Reader Interactions

Comments

  1. Kristie says

    May 7, 2014 at 6:06 pm

    Thanks! Worked perfectly!

    Log in to Reply
  2. George says

    March 2, 2014 at 8:15 pm

    Thanks for sharing this post Brad. It is really usefull! I just have a question and you may can help me. I dont think it’s the best idea to repeat it here, you can see that at studiopress forums 🙂

    studiopress.com/forums/topic/last-modification-date-publish-date/

    Log in to Reply
    • George says

      March 3, 2014 at 11:23 am

      How about showing the modification date which will replace the publish date, or show the publish date if there’s no modification date? Will i need a completely new code?

      Log in to Reply
      • Brad Dalton says

        March 3, 2014 at 11:43 am

        Yes or modify the code to do that.

        Log in to Reply
  3. Alex says

    February 1, 2014 at 11:50 am

    Hi Brad, and thank you very much for sharing this super useful code.

    Is there any way to apply “Remove Original Date & Show Updated Date Only” for all posts EXCEPT those of certain categories or even a single one whose posts would display both the original date and the updated date if applicable?

    Log in to Reply
    • Brad Dalton says

      February 1, 2014 at 12:07 pm

      Sure is Alex. You can use code to remove the date conditionally and then use this code to display the updated date only with or without conditionals.

      Log in to Reply
  4. Derek says

    November 8, 2013 at 3:32 am

    Thanks for your help. I was able to get it to say what I wanted to say.

    Last updated: Wednesday, November 6, 2013 .

    At this rate, I am learning more and more about Genesis hooks on my blog. lol

    Ok, off to find the next thing to customize for this weekend. Have a good night Brad.

    Log in to Reply
    • Brad Dalton says

      November 8, 2013 at 3:51 am

      No worries Derek

      Log in to Reply
  5. Derek says

    November 7, 2013 at 5:58 am

    I uninstalled Simple Edit’s and still no chage. hmm..
    I’m in the magazine pro theme. I may have to work on this during the week. It’s 1a.m. and eyes are failing me.

    Log in to Reply
    • Brad Dalton says

      November 7, 2013 at 6:26 am

      Know the feeling well.

      Log in to Reply
      • Derek says

        November 7, 2013 at 2:04 pm

        With simple edit’s still uninstalled, could not get it to work. I’m not a programmar so I removed this and will see if there is a plugin then. I guess another plugin I am using his same hook’s.

        Log in to Reply
        • Brad Dalton says

          November 7, 2013 at 10:05 pm

          Which code snippet are you using?

          Log in to Reply
          • Derek says

            November 8, 2013 at 2:33 am

            Brad, I seem to have took a different approach to doing this. I got it working minus now trying to remove the actual time that is added to the last updated date in the posts now.

            I used this plugin: http://wordpress.org/plugins/last-updated-shortcode/faq/

            Then added: [lastupdated]

            To this code in my functions PHP file: http://my.studiopress.com/snippets/post-info/#customize

            The usernames still go to there archive which is what I wanted. I took a different approach but seems to be working minues removing the time in the post info.

          • Brad Dalton says

            November 8, 2013 at 2:59 am

            Good stuff.

            You can remove the time by changing the time format and/or using CSS or PHP code.

  6. Derek says

    November 7, 2013 at 4:36 am

    I added that code and it works find Brad, but the username’s if clicked on get redirected to there homepage they have listed in there profile.

    Does the code above in your post not link the username to there user archive? I have the simple edits plugin installed and have this on first line: September 5, 2013 By Brad Dalton 22 Comments

    Log in to Reply
    • Brad Dalton says

      November 7, 2013 at 5:32 am

      Hello Derek

      The code and the plugin use the same hook so it might not work.

      Try using one at a time rather than both.

      You could also remove the author link or modify the code.

      Log in to Reply
  7. Les Campbell says

    September 7, 2013 at 9:49 pm

    I tried the above mentioned code and it did not remove the original line. It now shows as follows:

    September 5, 2013 By Les Campbell · Leave a Comment · (Updated: September 7, 2013)

    September 5, 2013 By Les Campbell Leave a Comment (Edit)

    Log in to Reply
    • Brad Dalton says

      September 8, 2013 at 3:20 am

      Hi Les.

      Yes, that’s the way it works. It shows the original date and the updated date.

      I also added code which only displays the updated date if that’s what you want.

      Log in to Reply
      • Les Campbell says

        September 8, 2013 at 1:12 pm

        The post page displays two lines at the top of the page after I added the code you mentioned. The 1st line would displayed is your code and the 2nd line dissplayed is the default code. I did some research on the code you provided and discovered if I add “,12” to your code this eliminates the 2nd line to the post page. Here is the code that corrected the problem:

        remove_action( ‘genesis_entry_header’, ‘genesis_post_info’,12 );

        ================================================
        September 5, 2013 By Les Campbell · Leave a Comment · (Updated: September 7, 2013)

        September 5, 2013 By Les Campbell Leave a Comment (Edit)
        =================================================

        The code I provided removes the default line that is being displayed. I now have the correct line showing the post pages as follows:
        ================================================
        September 5, 2013 By Les Campbell · Leave a Comment · (Updated: September 7, 2013)
        ================================================

        Log in to Reply
        • Brad Dalton says

          September 8, 2013 at 2:01 pm

          Thanks for sharing this Les.

          I did see the post info being displayed twice as you mentioned once i added the code locally so i appreciate your solution and will add this to the code in this post.

          I wrote about the 3rd parameter for positioning priority a while ago which enables you to use different functions with the same hook in different positions.

          If you don’t add the 12, then you don’t remove the default post info from the default position therefore it remains and you add back the new updated post info as well.

          Log in to Reply
  8. chris says

    September 6, 2013 at 6:20 pm

    I use the News theme which already has a filter on that part, so I had to incorporate it into the filter:

    add_filter( 'genesis_post_info', 'post_info_filter' );
    
    function post_info_filter($post_info) {
    
    if ( !is_page() ) {
    
        $post_info = '[post_date] Written by [post_author_link], [post_comments] [post_edit]';
    	$published = get_the_date( 'F j, Y' );
    	$modified = the_modified_date( 'F j, Y', '', '', FALSE );
    	$published_compare = get_the_date( 'Y-m-d' );
    	$modified_compare = the_modified_date( 'Y-m-d', '', '', FALSE );
    	if ( $published_compare < $modified_compare ) {
    		$post_info = $post_info . &#039;<em>&middot; (Updated: ' . $modified . ')</em>';
    	}
        return $post_info;
    
    }}
    Log in to Reply
    • Brad Dalton says

      September 7, 2013 at 3:36 am

      Thanks Chris.

      I tested your code and it works perfectly.

      Thanks for sharing your solution.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems