Include icon markup in the post category and tag shortcodes. Note that the icon classes in the code below are set to work with Font Awesome icons.
The same code can be used for custom taxonomies by including the shortcode.
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
/** | |
* Display icon markup before post categories and tags | |
* @param string $post_meta | |
* @return string | |
*/ | |
function nn_post_meta( $post_meta ) { | |
$icon_category = "<i class=\'fa fa-folder-open\'></i>"; | |
$icon_tag = "<i class=\'fa fa-tag\'></i>"; | |
$post_meta = sprintf( | |
' ', | |
$icon_category, | |
$icon_tag | |
); | |
return $post_meta; | |
} | |
add_filter( 'genesis_post_meta', 'nn_post_meta' ); |