[Resolved] Sidebar on mobile

Home Forums Support [Resolved] Sidebar on mobile

Home Forums Support Sidebar on mobile

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2064359
    Den

    Hello team,

    I want to remove both sidebars on mobile. (But not by using CSS) I don’t just want to hide. I want to completely remove it in order to maintain the page load speed.

    Please help me out. I always get amazing support from you guys.

    Waiting for your reply.

    #2064441
    Leo
    Staff
    Customer Support
    #2064447
    Ying
    Staff
    Customer Support

    Hi Den,

    You can also try this:

    1. Go to appearance > elements, create a layout element, chooseContent (no sidebars), select locations depending on your needs.

    2. Add this PHP snippet:

    add_filter( 'generate_element_display', function( $display, $element_id ) {
        if ( !wp_is_mobile() && 2134=== $element_id) { 
            $display = false;
        }
    
        return $display;
    }, 10, 2 );

    Replace 2134 with your element ID which can be found at the element editor URL:
    https://www.screencast.com/t/ylB1XTQtvF

    #2065499
    Den

    I have many other memberships but the support I get from you guys (Generatepress) is topnotch.

    Thank you so much, Leo and Ying. and Happy New Year !

    #2066658
    Ying
    Staff
    Customer Support

    You are welcome Den!

    Happy new year 🙂

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