Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Last active August 29, 2015 14:19
Show Gist options
  • Save eri-trabiccolo/64a7b7203bf7cb034a26 to your computer and use it in GitHub Desktop.
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
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