Archived topic
How to hide a section
8 replies · Started by Jamie on November 26, 2018
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!
Hi there,
Are you referring to GP's Sections?
https://docs.generatepress.com/article/sections-overview/
Let me know :)
Yes I am!
You could just add these three built in classes as custom classes:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes
https://docs.generatepress.com/article/sections-overview/#layout
Let me know :)
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:
Each section doesn't have it's own area to add code, so how can you use it for one specific section?
Thanks
<div class="hide-on-desktop">
Content here will only display in Desktop
</div>
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.
Perfect, thanks for your help!
No problem :)