Problem
Genesis Post Info is the information about the post (post date, author, comments) that typically displays just below the title on your posts.
If you have a Post Type that doesn’t support an “Author” for the post, the post info will display the “by” component followed by an empty block.
Solution
Check the current post type to see if it supports authors. If it doesn’t, don’t include the “by” component of the Genesis post info.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ' | ';|
} else { | |
return ' ' . __( 'by', 'genesis' ) . ' | ';|
} | |
} |