Created
May 13, 2017 03:16
-
-
Save congthien/ab59bf092ebb88e6fb0b9e98de770f15 to your computer and use it in GitHub Desktop.
move header after hero section
This file contains 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
/** | |
* More header after hero section for front page only. | |
* | |
*/ | |
function oneify_move_header(){ | |
if ( is_page_template( 'template-frontpage.php' ) ) { | |
remove_action( 'onepress_site_start', 'onepress_site_header' ); | |
add_action( 'onepress_after_section_hero', 'onepress_site_header' ); | |
} | |
} | |
add_action( 'wp', 'oneify_move_header' ); | |
/** | |
* Adds custom classes to the array of body classes. | |
* | |
* @param array $classes Classes for the body element. | |
* @return array | |
*/ | |
function oneify_body_classes( $classes ) { | |
if ( is_page_template( 'template-frontpage.php' ) ) { | |
$classes[] = 'header-after-hero'; | |
} | |
return $classes; | |
} | |
add_filter( 'body_class', 'oneify_body_classes', 75 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment