Wraps and the likes

Community Forums Forums Design Tips and Tricks Wraps and the likes

This topic is: resolved

Tagged: ,

This topic contains 9 replies, has 2 voices, and was last updated by  SoZo 1 year, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #16152

    NWTD
    Participant
    Post count: 61

    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!

    • This topic was modified 1 year, 10 months ago by  NWTD. Reason: formatting
    • This topic was modified 1 year, 10 months ago by  NWTD.
    • This topic was modified 1 year, 10 months ago by  NWTD. Reason: formatting
    • This topic was modified 1 year, 10 months ago by  NWTD.
    #16162

    SoZo
    Moderator
    Post count: 1573

    No, 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

    #16167

    NWTD
    Participant
    Post count: 61

    Thanks 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?

    #16168

    SoZo
    Moderator
    Post count: 1573

    You 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

    #16177

    NWTD
    Participant
    Post count: 61

    is 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

    #16179

    SoZo
    Moderator
    Post count: 1573

    Yep, but your missing the semi-colon at the end of the echo line
    [php]
    function add_div() { echo ‘div class="header-wrap">'; }
    [/php]


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #16181

    NWTD
    Participant
    Post count: 61

    Awesome. 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?

    #16182

    SoZo
    Moderator
    Post count: 1573

    No, 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

    #16495

    NWTD
    Participant
    Post count: 61

    Awesome. I’m all set. thanks!

    #16499

    SoZo
    Moderator
    Post count: 1573

    You’re welcome :)


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Wraps and the likes’ is closed to new replies.