Skip to content

Instantly share code, notes, and snippets.

@topleague
Last active June 8, 2017 09:57
Show Gist options
  • Save topleague/772e723532464da8ee6df048c5e0bf74 to your computer and use it in GitHub Desktop.
Save topleague/772e723532464da8ee6df048c5e0bf74 to your computer and use it in GitHub Desktop.
Customize the Post Info Conditionally on Home Page and Single Post in Genesis Sample Theme
// Customize the Post Info Conditionally on Home Page and Single Post in Genesis Sample Theme
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter( $post_info ) {
if ( is_front_page() || is_archive() ) :
$post_info = '[post_date] [post_comments zero="0 Comments" one="1 Comment" more="% Comments"]';
return $post_info;
elseif (is_single()) :
$post_info = 'By [post_author_posts_link] on [post_date] [post_comments zero="0 Comments" one="1 Comment" more="% Comments"]';
return $post_info;
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment