Created
October 8, 2013 09:53
-
-
Save csknk/6882353 to your computer and use it in GitHub Desktop.
Add category page title (WordPress)
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
/***Category Page Title****/ | |
function add_category_page_title() { | |
$cat = get_category( get_query_var( 'cat' ) );/* gets the category info of the current archive page*/ | |
$cat_name = $cat->name; /*pass the value of the category to name, and attach this to the variable*/ | |
?><h2>Articles categorised as: <?php echo $cat_name;?></h2> /*build the headline*/ | |
<?php | |
} | |
add_action('hook_top_category_page_title', 'add_category_page_title'); /*add function to a Thesis 2.1 hook*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment