-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove structural .wrap divs? #63
Comments
@bryanwillis, thanks for the through provoking notes. Based on offline conversations and my own thoughts, I agree with you that we should remove the structural wraps. Quickly looking at some links out there
they all seem to be adding, not removing. Are structural wraps adding somewhere else in the theme which we can remove? A quick search didn't turn up "genesis-structural-wraps" anywhere. I want to be certain we're not adding and removing the feature (rather than simply not adding it in the first place). I do like the idea of changing the I've also opened #69 to address the broader questions you've brought up. |
By default genesis checks to see if your child theme has support for structural wraps and if not then it automatically adds it. You're right there doesn't seem to be any documentation on removing the wraps on the internet. Pretty surprising. Genesis tries to check if you have added support or not on line 63 in genesis/lib/init.php if ( ! current_theme_supports( 'genesis-structural-wraps' ) )
add_theme_support( 'genesis-structural-wraps', array( 'header', 'menu-primary', 'menu-secondary', 'footer-widgets', 'footer' ) ); Because of this if you attempt to use So here are the options I've come up with: function bsg_remove_genesis_structural_wraps() {
remove_theme_support( 'genesis-structural-wraps' );
}
add_action( 'after_setup_theme', 'bsg_remove_genesis_structural_wraps', 11 ); However even easier (and since you like limiting amount of code we could simply do the following and trick genesis into thinking were adding theme support. add_theme_support( 'genesis-structural-wraps', '' ); In terms of performance, I'm not sure if either method is better than the other. // If we want to add it only to specific areas we could do this
function bsg_remove_some_genesis_structural_wraps() {
remove_theme_support( 'genesis-structural-wraps' );
add_theme_support( 'genesis-structural-wraps', array( 'post' ) );
}
add_action( 'after_setup_theme', 'bsg_remove_some_genesis_structural_wraps', 11 ); Personally I like this the best: add_theme_support( 'genesis-structural-wraps', '' ); My reasoning is that it can be added anywhere. So you could add it to https://github.com/salcode/bootstrap-genesis/blob/develop/lib/genesis-setup.php and the user will still be able to add wraps again at the end of functions php and it will take precedence over the one in genesis-setup.php. |
Now that I understand Genesis is adding structural wraps for certain elements by default, I like your original patch #61 Adding
directly in I like your original |
We are not using the Genesis structural wrap divs,
div.wrap
, within Bootstrap Genesis, however this is a starter theme and I'm wondering if others often use them when building a theme. In particular, building something like a full-width header or footer comes to mind?I realize they can be added back easily enough but if they're often used, I'm tempted to keep them in.
@codenameEli, @dustyndoyle, @tbcorr Do you have objections to removing these by default?
No reply will be assumed to be agreement on removing them.
See patch #61
The text was updated successfully, but these errors were encountered: