Forked from Lego2012/automatically-display-titles-on-category-and-tag-archives.php
Created
April 28, 2021 12:41
-
-
Save mzdebo/ab6965250467e1fd556e18ac1a8b0a82 to your computer and use it in GitHub Desktop.
Automatically display titles on Category and Tag Archives #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
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
/** | |
* Default Category Title | |
* | |
* @author Bill Erickson | |
* @url http://www.billerickson.net/default-category-and-tag-titles | |
* | |
* @param string $headline | |
* @param object $term | |
* @return string $headline | |
*/ | |
function be_default_category_title( $headline, $term ) { | |
if( ( is_category() || is_tag() || is_tax() ) && empty( $headline ) ) | |
$headline = $term->name; | |
return $headline; | |
} | |
add_filter( 'genesis_term_meta_headline', 'be_default_category_title', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment