Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Created April 22, 2015 15:54
Show Gist options
  • Save eri-trabiccolo/14f78a8aeeba97f9c24c to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/14f78a8aeeba97f9c24c to your computer and use it in GitHub Desktop.
Custom tax archive title patch
add_filter('tc_display_customizr_headings', 'display_headings_in_archives', 20);
function display_headings_in_archives( $bool ){
return is_archive() ? false : $bool;
}
add_filter('tc_archive_header_class', 'my_tax_header_class', 100 );
function my_tax_header_class( $_title ){
return is_archive() ? array('archive-header') : $_title;
}
add_filter('tc_headings_archive_html', 'my_tax_title_description', 100 );
function my_tax_title_description( $_title ){
if ( is_archive() && ! $_title ){
$content = sprintf('<h1 class="%1$s">%2$s</h1>',
apply_filters( 'tc_archive_icon', 'format-icon' ), /* handle tax icon? */
apply_filters( 'tc_tax_archive_title', get_the_archive_title() )
);
$tax_description = get_the_archive_description();
if ( apply_filters( 'tc_show_tax_description', $tax_description ) )
$content .= sprintf('<div class="archive-meta">%1$s</div>',
$tax_description
);
return apply_filters( 'tc_tax_archive_header_content', $content );
}
return $_title;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment