Sticky Header - Remove from specific page, fix jumping
Not sure if this is the best way to go about this but when I have sites using the sticky header sometimes I want to disable it on specific pages (which still isn't an option in custom layouts yet). i.e. such as unique landing pages for marketing purposes.
I found that if I load my own "page" specific js via functions.php and include something like this to remove the body class "sticky-header" that solves the problem in the cases I don't want the sticky header. This works because the sticky function looks for this class to be able to trigger itself.
(function($){
//remove sticky header function
$('body').removeClass('sticky-header');
})(jQuery);
However, in the case where I do want it but the content height is just slightly taller than the viewport height, I haven't found a solution for the content jumping. Just curious if anyone has any suggestions, thanks.
Comments
to remove sticky header from specific pages, you can use the following css instead: where xxx is PAGE ID.