I have a site running Genesis that I’m switching to GeneratePress. There’s some stuff in my old child theme’s functions.php that I’m trying to bring over to GP using the Code Snippets plugin.
One thing I previously had was some code to show the “last updated” date on single post pages, but show the “posted on” date on other types of pages. This code made that happen…
add_filter( ‘genesis_post_info’, ‘sp_post_info_filter’ );
function sp_post_info_filter($post_info) {
if ( is_singular( ‘post’ ) )
$post_info = ‘Last Updated on [post_modified_date]’;
if ( is_archive( ) )
$post_info = ‘Posted on [post_date]’;
if ( is_home( ) )
$post_info = ‘Posted on [post_date]’;
if ( is_search( ) )
$post_info = ‘Posted on [post_date]’;
return $post_info;
}
How do I adapt this to GP? I already changed genesis_post_info to generate_post_date_output which seems to be correct, but now instead of the dates I just have the actual text of “[post_modified_date]” or “[post_date]” displaying.
Any ideas?
Thanks.