[Resolved] Disable section when displayed on mobile

Home Forums Support [Resolved] Disable section when displayed on mobile

Home Forums Support Disable section when displayed on mobile

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #268454
    Callum

    Hello!

    I have a website that is built predominently with sections which displays well on desktop. The issue we have is when displayed on mobile the height of the section images (which are used as a header below the menu) do not resize leaving the layout looking out of proportion.

    Is there a was (with custom CSS or otherwise) that we would be able to either have the section disable when displayed below a certian size?

    Any help would be much appriciated.

    Page link: http://www.musicangelsocialpower.com/music-angel-foundation-about/

    Thanks,

    MA Team.

    #268461
    Leo
    Staff
    Customer Support

    Hi Callum,

    With the new GP Premium 1.2.93, you can assign a Custom ID to each section. Then you can hide them in mobile with this CSS:

    @media (max-width: 768px) {
        #MYCustomID {
            display: none;
        }
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    Let me know.

    #268526
    Tom
    Lead Developer
    Lead Developer

    You can also use the built in CSS classes:

    hide-on-desktop
    hide-on-tablet
    hide-on-mobile
    #269865
    Callum

    Hi all,

    Thank you very much – Leo your fix worked perfectly!

    #269867
    Leo
    Staff
    Customer Support

    You’re welcome 🙂

    Thought I’d mention that Tom’s solution is probably easier than mine though…
    You just have to enter those CSS classes in the Custom Classes field inside Section Settings:
    https://docs.generatepress.com/article/sections-overview/#opening-the-section-settings

    But they do the same thing!

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