Display SubMenu Just Below the Header

No results found. Try again with different words?

Search must be at least 3 characters.

Display SubMenu Just Below the Header

If you have observed, whenever you hover the parent menu, the submenu opens just below the parent menu. No matter what your header height is. In this case, submenu cuts the header and display over it just below the parent menu.

In the Astra Theme version 1.5.0 and above we are introducing a filter that will open a submenu below the header without cropping it. You can enable this functionality by adding the following filter to the child theme’s function.php file.

add_action( 'wp', 'astra_open_submenu_below_header' );
function astra_open_submenu_below_header() {
  if ( false === astra_get_option( 'submenu-below-header', true ) ) {
    add_filter( 'astra_submenu_below_header_fix', '__return_true' );
  }
  add_filter( 'astra_submenu_open_below_header_fix', '__return_true' );
} 

This filter introduces padding difference of ~5px in the header.

How this will work for existing sites –

For the existing sites, those will update to this version (1.5.0) the above change will be disabled by default. You can enable this by adding the above filter.

How this will work for new installations –

If you freshly installed Astra Theme with version 1.5.0 and above the above functionality will be enabled by default. You don’t need to add any snippet.

The functionality of the filter is shown below:

Before adding a filter:

Astra Mega Menu

After adding a filter:

Astra Header Options
Was this article helpful?
Did not find a solution? We are here to help you succeed.

Related Docs

Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form