How to create sticky (fixed) header for Sparkling WordPress theme?

hey guys ! First congrats for the theme, it’s awesome !
This should be on Themeforest but I’m really happy its free for users.

I have a request. Could you make the menu sticky ? Like when you scroll down, the header will be sticky.

Thank you for your kind words! :slight_smile:

To create fixed/sticky menu:

Open header.php and replace

<nav class="navbar navbar-default" role="navigation">

with

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">

These changes can be done via Child Theme as well. But it is up to you.

Now you will see that part of content area will be hidden behind menu because menu is taken out and added on the top of it. This can be fixed by moving content area slightly down by adding this to Theme Options - Other - Custom CSS

#content {
    margin-top: 44px;
}

Hi there, great theme and love that there is an option for sticky navbar.

However I have noticed that the navbar is now slightly hidden under the wordpress toolbar/admin bar, and I was wondering if there’s a fix to add a margin/padding above the navbar so that all of its content can be seen.

Thanks for any help

You can get this code by simply adding this to Theme Options - Other - Custom CSS

.admin-bar .navbar-fixed-top {
padding-top:32px; 
}

Worked brilliantly, thank you very much for this

How do I get to php.header?

Hello

I noticed that custom CSS works only on main page and doesnt work on single post page. How to fix it?