How to Disable Primary Header?

How to Disable Primary Header?

You can disable Astra Primary Header from the entire site by adding a filter code to the child theme』s functions.php file. 

If you』re using the Old (Legacy) Astra Header for your website, you can add the following code:

add_action( 'wp', 'astra_remove_header' );

function astra_remove_header() {
remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
}

On the other side, if you』re using the new Header Footer Builder (or decided to switch to it from the Legacy Header), you will need to use a different code instead:

add_action( 'wp' , 'astra_remove_new_header' );

function astra_remove_new_header() {
remove_action( 'astra_primary_header', array( Astra_Builder_Header::get_instance(), 'primary_header' ) );
remove_action( 'astra_mobile_primary_header', array( Astra_Builder_Header::get_instance(), 'mobile_primary_header' ) );
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注