You’ve most likely noticed a sticky header in motion sooner than, even on a WordPress website. They practice you as you scroll down the web page, making navigating a website online faster and more uncomplicated. They are able to even building up engagement by way of protecting the website menu at all times a click on away.

However in spite of its reputation, this sexy UX design isn’t constructed into WordPress by way of default. Headers will generally keep put on the best of the website online. So, how are you able to make your header sticky?

There are a number of other strategies, from the use of WordPress blocks over putting in a plugin to the use of code. Let’s duvet among the easiest of them in addition to easiest practices for the use of sticky headers in your website.

What’s a Sticky Header?

wordpress sticky header

As its identify implies, a header rests on the best of the webpage. It’s generally outstanding by way of separate colours and a couple of vital hyperlinks. In this very website online, the header incorporates the brand, hyperlinks to probably the most helpful pages, and a seek bar.

Torquemag header example

A sticky header may be known as a set header. It’s the kind that is still visual on the best of the display screen whilst you scroll down – it “sticks”. That suggests customers don’t must scroll all of the long ago up to make use of the navigation menu, seek box, or another parts you’ve on your header. Occasionally a sticky header gets smaller as you scroll, getting rid of all however a couple of vital parts.

You’ll discover a excellent instance of a sticky header on Elementor’s homepage, which cleverly blends into the hero symbol till you scroll down.

elementor wordpress sticky header example

Yoast’s website online additionally includes a sticky header. This one is a bit more fancy and has a couple of amusing animations.

yoast wordpress sticky header example

Why Upload a Sticky Header to WordPress?

Sticky headers aren’t only a design selection – regardless that they’re visually fascinating. They’re additionally a practical internet design software with a number of advantages.

  • Decreased soar charge and better customer retention – When folks have navigational hyperlinks in achieve, they’ll select to stick round. Conversely, having to scroll all of the technique to the highest of an extended webpage may lead them to surrender and depart.
  • Greater engagement – For identical causes, you’ll in finding extra folks clicking the hyperlinks on your header. Folks keep and skim longer if you’re making their lifestyles more uncomplicated.
  • Just right UX – No person likes a ton of scrolling. A sticky header is just a excellent UX selection on longer pages, decreasing scroll time to 1 click on somewhat than a number of seconds.
  • Fascinating design – As you’ll see from the examples above, a sticky header isn’t simply helpful; it offers you a possibility so as to add cool transition animations and somewhat extra visible hobby.
  • Higher conversion charges – You need to position CTA buttons on your sticky header, attracting extra clicks because it stays on display screen 100% of the time.

4 Techniques to Upload a Sticky Header to Your Site

Now let’s get into all of the tactics you’ll upload a sticky header to WordPress. Some of these will also be achieved and not using a coding wisdom in any respect, regardless that we’ll additionally point out code a sticky header your self.

Set up a Sticky Header Plugin

use a wordpress plugin to make the header sticky

The most simple method so as to add a sticky header to WordPress is to set up a plugin. This may allow you to make your headers sticky it doesn’t matter what theme you’re the use of. Listed here are among the easiest sticky header plugins.

  • My Sticky Bar – The most well liked sticky menu plugin comes with a ton of capability. Whilst developing notification bars is one giant draw, you’ll additionally make your header, sidebar, or menu sticky too. Some options, like CSS styling or disabling the sticky function on positive pages, require the professional model.
  • Sticky Menu & Sticky Header – Some other fashionable sticky header plugin means that you can make anything else in your website online sticky – regardless that just one part at a time. This may paintings completely for purchasing your header to scroll. The professional model of this plugin means that you can stick any selection of parts and use their visible part picker.
  • Elementor – Whilst Elementor is basically a website online builder, it additionally comes with more than a few design tweaks, results, and expansions for WordPress. This type of is the facility to make Elementor headers sticky.
  • Divi – Very similar to Elementor, Divi is a web page builder that makes use of the Divi theme as a base. As a part of its many web page construction options, you’ll additionally create a sticky header – or a sticky anything else.

Set up a Theme with Sticky Header Give a boost to

As a substitute of putting in a separate plugin, it’s essential to as an alternative obtain a theme that incorporates sticky header capability inbuilt.

sydney theme header option

There are heaps of topics available in the market with sticky headers, so that you’ll have to move theme searching. However listed below are a couple of topics that do come with sticky headers.

  • Sydney – Sydney is a well known freemium WordPress theme adapted in opposition to companies. It includes a blank and ergonomic design, and springs with a lot of design options to tweak, together with sticky navigation.
  • On-line Store – Simply because the identify implies, On-line Store is a unfastened theme particularly well-suited for ecommerce shops. There’s a lot of dynamic customizability, with a sticky menu and sidebar simply one of the choices.
  • Astra – The immensely fashionable Astra theme was once designed to be customizable, so it’s herbal that it will come with sticky parts. You’ll want to turn on the Sticky Header module.
  • Hestia – This pretty, fashionable theme is excellent for industry internet sites and portfolios. Sticky header capability is constructed proper into the theme.
  • Blocksy – The Blocksy theme was once made only for Gutenberg, designed to be flexible and are compatible in with quite a lot of website online ideas. You’ll want the Blocksy Significant other plugin to permit sticky headers.
  • Delicio – This top class eating place theme is gorgeous and fashionable, and springs with a lot of design options to tweak, together with the subject of this publish.
  • Felt LT – Felt LT is a gorgeous full-screen mag theme, that includes a modular structure with integrated widgets and an exquisite scrolling header.

Upon getting your theme put in, you’ll typically in finding additional design settings like sticky header make stronger in Look > Customise or Look > Editor in your Dashboard.

Use WordPress Blocks

Due to new options launched in WordPress 6.2, you’ll now use the Team block to create a sticky header in WordPress with out plugins. You’ll in finding an legitimate instructional at the Be told WordPress hub. Let’s undergo it.

First, move to Look > Editor and open the Pages template (or anyplace you wish to have the header to look). Click on the 3 vertical strains to open Record View.

open list view in wordpress editor to edit header

Make a selection the header and click on the 3 vertical dots subsequent to it, then click on Team to wrap your header in a bunch block.

create header group

Now click on the 3 vertical dots within the best proper nook and open your Settings web page. Open the Place tab and make a choice Sticky.

make group block sticky in wordpress editor

Now click on the part moon image within the Settings tab and make a choice a background colour on your Team block. That is so your design doesn’t glance bizarre if the sticky header is see-through.

change wordpress header background color

With that, you’ve a easy sticky header, no plugins required! Now get started styling your header and making it stunning.

Code a Sticky Header

In spite of everything, when you’ve got the CSS and Javascript technology, you’ll merely code your individual sticky header. This calls for some fundamental internet building wisdom.

There are two tactics to code a sticky header: With CSS and Javascript, or with natural CSS.

For instance, theoretically, you’ll merely create a sticky header by way of including the place: fastened; or place: sticky; belongings to it, like so:

.site-header {
	place: sticky;
}

Sadly, actually, it isn’t at all times that straightforward. If you wish to have an instance of a sticky header purely made with CSS, you’ll take a look at this one on CodePen.

pure css sticky header codepen example

As discussed, any other risk is to additionally use JavaScript. Right here, you generally upload a CSS magnificence on scroll that gives the stickiness. Within the sticky header instructional on W3Schools, that is the phase that provides the category:

// When the person scrolls the web page, execute myFunction
window.onscroll = serve as() {myFunction()};

// Get the header
var header = report.getElementById("myHeader");

// Get the offset place of the navbar
var sticky = header.offsetTop;

// Upload the sticky magnificence to the header while you achieve its scroll place. Take away "sticky" while you depart the scroll place
serve as myFunction() {
	if (window.pageYOffset > sticky) {
		header.classList.upload("sticky");
	} else {
		header.classList.take away("sticky");
	}
} 

And this is the CSS itself:

.sticky {
	place: fastened;
	best: 0;
	width: 100%
}

As you’ll see, it makes use of the similar place: fastened; belongings that we already mentioned previous.

So, why would you employ JavaScript as an alternative of simply natural CSS?

When you’ve got the precise abilities, JavaScript lets you upload extra animations for your sticky header. Whilst there also are CSS animations, they don’t have the similar vary of chances. Then again, CSS nonetheless works even supposing guests have disables Javascript of their browsers. Finally, the choices is as much as you.

And if all that is an excessive amount of for you, you’ll at all times simply rent a developer.

6 Sticky Header Highest Practices

In case you are about to enforce a sticky header in your website online, now we have some design easiest practices for you to bear in mind. Whilst those are simply tips, deviating may flip your sticky header into an annoyance somewhat than a great tool.

Stay it Easy

the new yorker header example

In terms of parts which are completely on display screen, it’s easiest to stay it so simple as conceivable. 

  • Don’t let your sticky header absorb a ton of display screen area. A big header can duvet up an excessive amount of content material and make studying and skimming stressful.
  • Keep away from overly evident colours and designs. Stay any transition animations fast and refined. You need to design your sticky header so there’s sufficient distinction that guests can simply see it, however no longer such a lot that it’s actively distracting.
  • Don’t muddle your header with too many menu pieces and hyperlinks. Use simplest probably the most treasured ones. Use transparent and descriptive labels.
  • Cut back area by way of applying icons, akin to by way of having the hunt bar change into a magnifying glass. That is particularly useful when optimizing for smaller monitors.

Even supposing your website online’s header is huge, makes use of shiny colours, or has a large number of hyperlinks by way of default, you’ll at all times configure it so it simplifies and will get smaller on scroll.

Make it Responsive

responsive sticky header example

Don’t overlook about small monitors and cellular units when making a sticky header. When construction your header, plan on a responsive design from the beginning.

  • Make the menu get more effective and more effective as display screen sizes get smaller. Take away much less vital hyperlinks, scale back symbol/brand measurement, and switch textual content into icons.
  • Cut back the header’s vertical area, as there’s little display screen actual property to paintings with.
  • Believe including a unmarried menu icon that pops out right into a complete navigation record.
  • Be certain any parts are sufficiently big to be simply tapped on cellular monitors.

Upload Animations

Just a little animation is going some distance in internet design. Even refined motion could make your sticky header appear so a lot more chic.

  • Upload a small transition animation when customers scroll down or again to the highest.
  • Particularly on cellular, imagine collapsing the menu and having it slide again on-screen when customers scroll up.
  • Believe making your sticky header clear, showing when customers hover the highest of the display screen.

Be sure Accessibility

Sticky headers can sadly introduce accessibility problems if carried out improperly. Stay the following pointers in thoughts.

  • Be certain your header works with assistive units like display screen readers. Supply ARIA attributes the place essential.
  • Be sure sticky header animations don’t wreck keyboard navigation. Customers must have the ability to navigate the menu the use of the tab key, and no longer have their surfing disrupted.
  • Design the header so it has sufficient distinction that visually impaired guests can learn it.
  • Use transparent and readable fonts somewhat than ornamental ones.

Tailor it to Your Logo

h and m branded sticky header example

Your sticky header must glance excellent in your website online and are compatible in completely with its design. It’s additionally a possibility to spotlight your emblem.

  • Incorporate your brand. It may possibly double as a hyperlink for your homepage.
  • Use your emblem colours within the background, textual content, and/or icons.
  • Design your header so it blends in effectively with the remainder of your website online, somewhat than taking a look misplaced.

Take a look at it Out

In spite of everything, at all times conscientiously check your sticky header – and another design alternatives in your website online – to make sure it really works effectively and is preferred by way of customers.

  • Make certain that the header works correctly on all units and display screen sizes. Take a look at each responsive wreck level.
  • Be certain it really works on all often used browsers.
  • Take a look at out the more than a few animations and ensure none of them wreck. See the way it interacts with different parts like drop-down menus, rotating a cellular tool, and so on.
  • Put into effect A/B checking out to peer what menu structure influences guests to stay round or engage.

Ultimate Ideas: Higher UX with Sticky Headers

Sticky headers are a small internet design part that may actually boost your website online and make issues much more handy on your customers.

Whether or not you put in a theme, upload a plugin, or make the header your self, be sure you stay our recommended easiest practices in thoughts. This may stay your sticky header stunning, helpful, and out there to all customers.

Which means did you employ so as to add a sticky header for your website online? Tell us within the feedback!

The publish 4 Simple Techniques Create a WordPress Sticky Header (+ Highest Practices) gave the impression first on Torque.

WordPress Agency

[ continue ]