[Support request] Mobile header on posts only

Home Forums Support [Support request] Mobile header on posts only

Home Forums Support Mobile header on posts only

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1618340
    Deniz Akay

    Hi,

    Is it possible to activate “mobile header” on woocommerce product pages only?

    I want to use my products as landing pages and don’t want to display my extended header on them specifically.

    Thanks!

    #1618403
    David
    Staff
    Customer Support

    Hi there,

    try adding this PHP Snippet, it will set the Mobile menu breakpoint to 10,000px if the page is a single product:

    add_filter( 'generate_mobile_menu_media_query', function( $width ) {
        if ( is_product() ) {
            $width = '(min-width: 10000px)';
        }
        return $width;
    } );
    #1618633
    Deniz Akay

    Thanks but I couldn’t make it work.

    Instead I hide header like this:

    @media screen and (max-width:489px){
    .woocommerce-page .site-header {
    display:none;
    }
    }

    Is it ok?

    #1618646
    David
    Staff
    Customer Support

    Aah ok, sorry i misunderstood. Yes thats a perfectly valid method to remove it 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.