Site logo

[Resolved] How to hide a section

Home Forums Support [Resolved] How to hide a section

Home Forums Support How to hide a section

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #740542
    Jamie

    Hi! Is there any way to hide a section on a page? I don’t want it to show yet, but will do in the future, and don’t want to have to create it from scratch again when I need it as it has quite a bit of code on there.

    Thanks!

    #740554
    Leo
    Staff
    Customer Support

    Hi there,

    Are you referring to GP’s Sections?
    https://docs.generatepress.com/article/sections-overview/

    Let me know 🙂

    #740579
    Jamie

    Yes I am!

    #740595
    Leo
    Staff
    Customer Support
    #740611
    Jamie

    Hi, where do I put this code? I put the following within the sections text box just to see if it hid on desktop and it didn’t work:

    Content here will only display in Desktop

    Each section doesn’t have it’s own area to add code, so how can you use it for one specific section?

    Thanks

    #740634
    Jamie
    <div class="hide-on-desktop">
        Content here will only display in Desktop
    </div>
    #740645
    Leo
    Staff
    Customer Support

    You don’t need to add any code at all. GP’s Sections allow you to add custom classes:
    https://docs.generatepress.com/article/sections-overview/#layout

    So simply copy hide-on-mobile hide-on-tablet hide-on-desktop and paste in there.

    #740668
    Jamie

    Perfect, thanks for your help!

    #740790
    Leo
    Staff
    Customer Support

    No problem 🙂

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