Skip to content

Instantly share code, notes, and snippets.

@JiveDig
Created October 18, 2017 14:59
Show Gist options
  • Save JiveDig/582e5400a6cfbe0882419ead44eb2e3c to your computer and use it in GitHub Desktop.
Save JiveDig/582e5400a6cfbe0882419ead44eb2e3c to your computer and use it in GitHub Desktop.
Disable sticky header and shrink header from Mai Pro (https://maipro.io).
<?php
/**
* Disable sticky header and shrink header from Mai Pro.
*
* @param array The existing body classes.
*
* @return array Modified classes.
*/
add_filter( 'body_class', 'prefix_disable_mai_sticky_shrink_header', 30 );
function prefix_disable_mai_sticky_shrink_header( $classes ) {
// Bail if not the page we want to disable on.
if ( ! is_page( 123 ) ) {
return $classes;
}
// Remove the header classes from the array.
$classes = array_diff( $classes, array( 'sticky-header', 'shrink-header' ) );
// Return our classes.
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment