About Sridhar Katakam
I am an independent WordPress web consultant with 10 years of experience in WordPress theme installation, customization, administration, maintenance, support, documentation, troubleshooting and PSD/design to WP.
Genesis and WordPress Tutorials
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.
Hey Sridhar,
Your code is the only one that works out of all the sites I have been to. I was wondering if there was a way to have it say “last updated on” and then the date that it was updated. Does your code notify google that there has been an update? So that date will show up in the search results instead of the published date?
See http://www.sridharkatakam.com/add-last-updated-date-post-info-genesis/
Not as far as I know. We are merely printing the last updated date. Whether Google takes that and shows in search results or not – I do not know.
[…] http://www.sridharkatakam.com/using-human-time-last-updated-date-genesis/#comment-4010 […]
It’s working well for me–thanks for posting! But I’m wondering if it’s possible to have the reverse. That is, if the post has been modified, then the “Posted on” line doesn’t appear.
So that instead of something like:
Posted one week ago
Last updated two days ago
it shows simply as:
Last updated two days ago
I’d prefer ONLY to show the last updated date, with a fallback to the post date if there haven’t been any modifications. I don’t need to show both.
Hi Sridhar,
I’ve implemented the above snippet and it’s working perfectly.
just wondering, Is there a way to make it conditional? Human time as above for single pages
and last modified date example day/month “12 Aug” on category/archive page.
I’ve found this snippet online for the archive date format i’m looking for just not sure how to make them both conditional
Any guidance would be much appreciated.
add_filter( ‘genesis_post_date_shortcode’, ‘child_post_date_shortcode’, 10, 2 );
function child_post_date_shortcode( $output, $atts ) {
return sprintf(
‘%1$s%2$s %3$s’,
$atts[‘label’],
get_the_time( ‘j’ ),
get_the_time( ‘M’ ),
get_the_time( ‘Y-m-d\TH:i:sO’ )
);
}
Many thanks