How to change published date to last updated with Genesis Framework

2
2
122 followers

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!


2
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

By continuing, you agree to our Terms of Service and Privacy Policy
No credit card required

Recent Comments

2

Sounds great, but I wonder if this would change my Permalink (date/name)

1

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.

1

See more comments

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

By continuing, you agree to our Terms of Service and Privacy Policy
No credit card required

2.9M+

Members

190+

Countries Served

20+

Years Online

50K+

Success Stories

The world's most successful affiliate marketing training platform. Join 2.9M+ entrepreneurs building their online business with expert training, tools, and support.

© 2005-2025 Wealthy Affiliate
All rights reserved worldwide.

🔒 Trusted by Millions Worldwide

Since 2005, Wealthy Affiliate has been the go-to platform for entrepreneurs looking to build successful online businesses. With industry-leading security, 99.9% uptime, and a proven track record of success, you're in safe hands.