• Rose

    (@thorned-rose)


    In the customiser settings for a transparent header, I can select “Disable on 404, Search & Archives?” but I only want to disable it for the search page. How can I do this? Is there a function I can tap into? e.g. ‘if is_search remove_action transparent header’ sort of thing?

    Thanks!

Viewing 1 replies (of 1 total)
  • Hi @thorned-rose ,

    Please use this filter in the child theme’s function.php file in order to disable the transparent header only from search result page.

    add_filter( 'astra_is_transparent_header', 'enable_transparent_header' );
    
    function enable_transparent_header( $enable_trans_header ) {
        $enable_trans_header = astra_get_option( 'transparent-header-enable' );
    
        if ( $enable_trans_header ) {
    
            if ( is_search() ) {
                $enable_trans_header = false;
            }
        }
        return $enable_trans_header;
    }

    I hope this will help.

    Regards,
    Deepak

Viewing 1 replies (of 1 total)
  • The topic ‘Transparent header disabled ONLY for search page’ is closed to new replies.