Community Forums › Forums › Design Tips and Tricks › Wraps and the likes
This topic contains 9 replies, has 2 voices, and was last updated by SoZo 3 months, 3 weeks ago.
-
AuthorPosts
-
January 29, 2013 at 4:12 pm #16152
This is kind of a two part question but the relate to each other.
First:
I’m using the Associate theme and am trying to customize the slider and home middle widgets. I’d like to take them out of the ‘inner’ div and put them in a new div of there own in between the ‘nav’ and ‘inner’ called something to the affect of ‘featured’
Second:
I also noticed in the functions.php there is a bit of code for including elements into a wrap:
/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'inner', 'footer-widgets', 'footer' ) );
Is it possible to us the genesis-structural-wraps to create different divs for grouping items? For instance, I’d want to group the ‘header’, ‘nav’, ‘subnav’, and ‘featured’ into one wrap, then ‘inner’ in another and lastly the ‘footer-widgets’ and ‘footer’ in their own.
The only purpose behind this is to accomplish some background customizations that are full width for these different sections.TIA!
January 29, 2013 at 4:20 pm #16162No, that isn’t what the structural wraps do.
If you want to move those elements out of the inner div you’d need to put them in a function using the after_header hook. Or of course change the hook that the existing function uses and move the home bottom sidebars into a different function.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 4:30 pm #16167Thanks John. I moved the slider around like I needed.
Do you have any suggestions for me to group the different sections into individual wraps of sorts?
January 29, 2013 at 4:32 pm #16168You can use the hooks to add opening and closing div tags that you can’t add directly in the template markup. e.g. add an opening tag in before_header and then a closing tag after your featured div.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 4:55 pm #16177is it as simple as
function add_div() { echo 'div class="header-wrap">'}
add_action( 'genesis_before_header', 'add_div' );?
I’m still new to genesis and learning it as I go. Thanks for your help John
January 29, 2013 at 4:59 pm #16179Yep, but your missing the semi-colon at the end of the echo line
function add_div() { echo 'div class="header-wrap">'; }
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 5:03 pm #16181Awesome. thanks!
One last thing. By default, everything under <body> is wrapped in a div, called, well, “wrap”. Can I use one of these hooks to remove that div completely?
January 29, 2013 at 5:04 pm #16182No, just remove the width from the #wrap rule. And then you’ll need widths and auto left/right margins for the containers you want to be centered.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 30, 2013 at 2:18 pm #16495Awesome. I’m all set. thanks!
January 30, 2013 at 2:22 pm #16499 -
AuthorPosts
The topic ‘Wraps and the likes’ is closed to new replies.