How to Remove Primary Navigation Menu in Astra?
|
/ Documentation /Custom Code Snippets/Astra Header & Footer Filters/ Remove Primary Navigation Menu with Hook

Remove Primary Navigation Menu with Hook

Description

To remove Primary Navigation Menu, you can add the following PHP code –

remove_action( 'astra_masthead_toggle_buttons', 'astra_masthead_toggle_buttons_primary' );
remove_action( 'astra_masthead_content', 'astra_primary_navigation_markup', 10 );

Example

function remove_primary_menu_callback() {
    remove_action( 'astra_masthead_toggle_buttons', 'astra_masthead_toggle_buttons_primary' );
    remove_action( 'astra_masthead_content', 'astra_primary_navigation_markup', 10 );
}
add_action( 'init', 'remove_primary_menu_callback' );

Check out the doc that explains how to add custom PHP code using the child theme’s functions.php file. 

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
On this page

Download is Just A Click Away!

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

This field is required.

REWIND

YEAR IN REVIEW

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