Lego2012
12/13/2016 - 3:44 PM

Automatically display titles on Category and Tag Archives

Automatically display titles on Category and Tag Archives

<?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 );