Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Last active January 10, 2017 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeardedGinger/58e4dedf77ab313571501c0137d73ae6 to your computer and use it in GitHub Desktop.
Save BeardedGinger/58e4dedf77ab313571501c0137d73ae6 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'genesis_post_info', 'lc_post_info' );
/**
* Filter the Gensis post info to not include the "by" component if
* the post type does not support authors.
*/
function lc_post_info() {
$post_type = get_post_type();
if ( ! post_type_supports( $post_type, 'author' ) ) {
return '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
} else {
return '[post_date] ' . __( 'by', 'genesis' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment