Skip to content

Instantly share code, notes, and snippets.

@congthien
Created May 13, 2017 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save congthien/ab59bf092ebb88e6fb0b9e98de770f15 to your computer and use it in GitHub Desktop.
Save congthien/ab59bf092ebb88e6fb0b9e98de770f15 to your computer and use it in GitHub Desktop.
move header after hero section
/**
* 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