Created
April 22, 2015 15:54
-
-
Save eri-trabiccolo/14f78a8aeeba97f9c24c to your computer and use it in GitHub Desktop.
Custom tax archive title patch
This file contains hidden or 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
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