Last active
August 29, 2015 14:19
-
-
Save eri-trabiccolo/64a7b7203bf7cb034a26 to your computer and use it in GitHub Desktop.
Swap h1 and h2 in tagline (destkop mode, in home) and slider
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_slide_title_tag', 'swap_h1_h2'); | |
add_filter('tc_tagline_tag', 'swap_h1_h2'); | |
function swap_h1_h2( $tag ){ | |
global $wp_current_filter; | |
$search_replace = array( | |
'h1' => 'h2', | |
); | |
if ( current_filter() == 'tc_tagline_tag' ){ | |
if ( tc__f('__is_home') && in_array('__navbar', $wp_current_filter ) ) | |
return str_replace( array_values($search_replace), array_keys($search_replace), $tag); | |
return $tag; | |
} | |
return str_replace( array_keys($search_replace), array_values($search_replace), $tag); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment