Showing updated date instead of published date

I wanted the post updated date to show instead of the published date. One can use a filter on the get_the_date and limit it to the archives and single posts etc. Not, great, tad misleading, but works for most themes (any that call get_the_date() anyway).

One can also override the theme’s function with a plugin.

Here’s the code if you just want to go the filter method:

<?php //add plugin header
function amr_use_updated_date ($the_date, $d, $post ) {
	if (is_archive() or is_home() or is_front_page() 
		or (is_single() and $post->post_type = 'post')) {
			if ( '' == $d ) 
				$the_date = mysql2date( get_option( 'date_format' ), $post->post_modified );
				$the_date = mysql2date( $d, $post->post_modified );
	return $the_date;

add_filter ('get_the_date', 'amr_use_updated_date', 3, 99);