Site logo

Archived topic

Sections set to disabled by default?

19 replies · Started by Collin on May 3, 2017

Viewing posts 1–15 of 20

Hello, when creating a new page/post I'd like to be able to have the checkmarks ticked by default so that all sections are de-activated by default. If I could predefine the boxes to be checked that'd save me a lot of time. Thanks!

Hi Collin,

Are you referring to the Sections add-on? It should be de-activated by default.

or are you looking to disable a certain element for all pages?

Let me know :)

I'm looking to disable certain/all elements for all posts/pages by default.

Can you list out all the elements you are wanting to disable?

Could be done with some CSS.

All of them, actually. Do they each have their own CSS id/class?

This CSS should cover all the elements that are in the Disable Element meta box:

.site-header,
#site-navigation,
.navigation-clone, 
#mobile-header,
#secondary-navigation,
.generate-page-header,
.page-header-image,
.page-header-image-single,
.entry-header,
.site-footer {
    display: none;
}

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

Does your Sections plug-in use CSS to function, similar to what you've provided here? I was under the impression it actually ensured the blocks of code for each section did not load (not just hide those sections with CSS).

You are right. My bad...

- Top bar: If no widgets are added, top bar wouldn't load.

- Header: https://docs.generatepress.com/article/generate_header/

- Primary Nav: Customizer > Layout > Primary Navigation > Navigation Location > No Navigation
https://docs.generatepress.com/article/generate_navigation_location/

- Secondary Nav: Wouldn't load if no secondary menu is added.

- Featured Image/Page Header: Customizer > Layout > Page Header > Single Post Header Location > Hide

- Content Title: https://docs.generatepress.com/article/generate_show_title/

- Footer:

add_action( 'after_setup_theme','tu_remove_footer' );
function tu_remove_footer() {
    remove_action( 'generate_footer','generate_construct_footer' );
}

Adding PHP: https://docs.generatepress.com/article/adding-php/

Let me know if you need more info.

Thanks Leo, but this is assuming I want to make the change globally. I don't want to do that. I only want to default to selecting all sections to be INACTIVE (instead of active) when I create a new page. Then I can choose which page sections to ACTIVATE each time instead of DEACTIVATING.

Currently that's not possible (well, it would require considerable programming).

Disable Elements will be getting an overhaul to allow default values + desktop/tablet/mobile visibility soon :)

Yes, Disable Elements. Thanks

Ok, thanks for the update Tom. I will survive clicking them all each time for now ;)

No problem! The defaults/responsive controls are pretty high up on my to-do list :)

Was this implemented?
My desire would be to set some defaults in the Customizer (e.g. footer and content title elements disabled) and then have every new page I generated thereafter have those settings, not requiring me to click them every time I create a new page. In other words, to have a basic page template that's not the norm.
On a related note, if I'd created 20 pages with those defaults and then needed to have the content title activated in all of them, is there some universal way to do that once and have it affect all 20 pages?

This archived topic is closed to new replies.