Add Utility Bar Before Site Header Removed On Scroll – Eleven40 Pro

This code adds a 2nd header before the default header. The 2nd header includes a clickable logo, smaller than the default header image as well as a search form.

Desktops – On desktops ( Above 960px width ), the smaller logo is positioned to the left, centered above the default header image and the search form is positioned to the far right, all within a custom structural wrap.

On scroll, the bar is removed :

On Scroll, remove utility bar

Mobiles – In this case, on mobiles ( less than 960px width ), both the smaller logo and the search box are centered, however, the CSS enables you to change the order of these elements at any screen width.

Watch the following demo video to learn how it works :

Demo Video #

Shows the bar displaying and then removed on scroll. Shows the bars elements repositioned and centered on mobiles.

Written and tested for the Eleven40 Pro child theme by StudioPress.

Note : Includes code to remove the bar on mobiles.

Code Installation #

There’s 4 steps :

Step 1 – Copy & paste the PHP code from the functions file to the end of the Eleven40 Pro themes functions.php file.

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.