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.
Thanks! Worked perfectly!
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/
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?
Yes or modify the code to do that.
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?
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.
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.
No worries Derek
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.
Know the feeling well.
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.
Which code snippet are you using?
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.
Good stuff.
You can remove the time by changing the time format and/or using CSS or PHP code.
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: By Brad Dalton 22 Comments
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.
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)
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.
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)
================================================
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.
I use the News theme which already has a filter on that part, so I had to incorporate it into the filter:
Thanks Chris.
I tested your code and it works perfectly.
Thanks for sharing your solution.