Add genesis custom post type category archive title in all category pages


Genesis WordPress theme, You can add category title to display in all the category archive page.To get around this issue if you have pagination on your category archives the problem is better solved with a function in your themes functions.php file




function categoryprefix_category_header() {
if ( is_category() )  {
echo '<h1 class="archive-title">';
echo single_cat_title();
echo '</h1>';
}
}
add_action( 'genesis_before_loop' , 'categoryprefix_category_header' );


This can also be applied to tags

function categoryprefix_tag_header() {
if ( is_tag() )  {
echo '<h1 class="archive-title">';
echo single_tag_title();
echo '</h1>';
}
}
add_action( 'genesis_before_loop' , 'categoryprefix_tag_header' );

No comments:

Post a Comment

how to call ssh from vs code

 To call SSH from VS Code, you can use the built-in Remote Development extension. This extension allows you to open a remote folder or works...