Created
August 15, 2017 07:12
-
-
Save generatepress/b3c574437f49c1fd26f4d6e9a3a6af55 to your computer and use it in GitHub Desktop.
Add categories and tags after the author
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
add_filter( 'generate_post_author_output', 'tu_categories_to_author' ); | |
add_filter( 'generate_category_list_output', '__return_false' ); | |
add_filter( 'generate_tag_list_output', '__return_false' ); | |
function tu_categories_to_author( $output ) { | |
$categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) ); | |
$categories_list = sprintf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', | |
_x( 'Categories', 'Used before category names.', 'generatepress' ), | |
$categories_list | |
); | |
$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) ); | |
$tags_list = sprintf( '<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', | |
_x( 'Tags', 'Used before tag names.', 'generatepress' ), | |
$tags_list | |
); | |
return $output . $categories_list . $tags_list; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment