How to change published date to last updated with Genesis Framework
I found a WordPress source code that shows you how to change the published date to last updated on Genesis Framework at this blog.
It has to be placed in functions.php which can be found by going into Appearance >> Editor in the WordPress Dashboard.
I am not sure if this works with other themes beside Genesis.
Here is the actual code. I wouldn't worry too much about the formatting. Just copy and paste into functions.php.
//* Create shortcode to store the proper date
add_shortcode( 'post_updated_date', 'rv_set_last_updated_date' );
function rv_set_last_updated_date( $atts ) {
if ( get_the_modified_time() != get_the_time() ){
$last_updated .= 'Last updated on ' . the_modified_date('M jS, Y','','',false);
return $last_updated;
} else{
$published_on .= 'Published on ' . get_the_time('M jS, Y',false);
return $published_on;
}
}
//* Do those shortcodes when the post has been updated
add_filter( 'genesis_post_info', 'rv_post_info_filter' );
function rv_post_info_filter( $post_info ) {
if ( is_home() ) {
$post_info = '[post_updated_date] By [post_author_posts_link]';
return $post_info;
} else {
$post_info = '[post_updated_date] by [post_author_posts_link] [post_comments before=""]';
return $post_info;
}
}
I took out one little part in the code above that showed the categories but it is still in the original code provided at the link.
I would like to thank you for reading and I hope that this helps you.
Have a blessed day!
Join FREE & Launch Your Business!
Exclusive Bonus - Offer Ends at Midnight Today
00
Hours
:
00
Minutes
:
00
Seconds
2,000 AI Credits Worth $10 USD
Build a Logo + Website That Attracts Customers
400 Credits
Discover Hot Niches with AI Market Research
100 Credits
Create SEO Content That Ranks & Converts
800 Credits
Find Affiliate Offers Up to $500/Sale
10 Credits
Access a Community of 2.9M+ Members
Recent Comments
2
Join FREE & Launch Your Business!
Exclusive Bonus - Offer Ends at Midnight Today
00
Hours
:
00
Minutes
:
00
Seconds
2,000 AI Credits Worth $10 USD
Build a Logo + Website That Attracts Customers
400 Credits
Discover Hot Niches with AI Market Research
100 Credits
Create SEO Content That Ranks & Converts
800 Credits
Find Affiliate Offers Up to $500/Sale
10 Credits
Access a Community of 2.9M+ Members
Sounds great, but I wonder if this would change my Permalink (date/name)
Hi Sonja :) Sorry for the late reply.
As far as I know, the code only changes the word "published on" to "last updated".
Also, if you never update the post, it will just show the published date.
Hope that helps you.