Community Forums › Forums › Archived Forums › General Discussion › Genesis structural wraps added into sections
- This topic has 11 replies, 3 voices, and was last updated 9 years, 7 months ago by Trish-ch.
-
AuthorPosts
-
August 15, 2014 at 12:14 pm #119022Trish-chMember
Hi,
I'm building some pages that will have full width layout divided into sections that will have full width background colors, some of these sections will have full width content and other sections content/sidebar within the same page.
I'm currently using the child theme Enterprise Pro, this theme has a div wrap applied to site-inner, I have managed to remove this wrap from the add_theme_support genesis structural wraps array but I'm trying to add the wrap to the sections instead by applying it this way:
add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'section', 'footer-widgets', 'footer', ) );
So far this is not working. To clarify this is what I'm trying to accomplish:
<div class="site-inner"> <section> <div class="wrap"> <article> </article> </div> </section> <section> <div class="wrap"> <article> </article> </div> </section> </div>
Any one knows how to achieve this?
Thanks
http://localAugust 15, 2014 at 12:32 pm #119024DTHkellyMemberSome reference:
August 15, 2014 at 12:55 pm #119028Trish-chMemberThanks for this link, my issue is more structural than css. I would like to add those wraps to the html markup by using genesis functions, once the structural wraps are in placed within the html, there is really no need for me to go into the css since the style for the default wraps are good enough. Just need to figure out the way to include those wrap divs after section divs in php.
Thanks
August 15, 2014 at 1:23 pm #119033Genesis DeveloperMemberHow are you inserting the following HTML markup inside the site-inner div?
<section> <div class="wrap"> <article> </article> </div> </section> <section> <div class="wrap"> <article> </article> </div> </section>
August 15, 2014 at 1:59 pm #119067Trish-chMemberHi,
I'm creating custom page templates and adding the section tags within the php elements I want to wrap in sections, the wrap class like content-sidebar-wrap is part of genesis framework and that's what I'm trying to add without having to hard code every page.
August 15, 2014 at 2:04 pm #119070Genesis DeveloperMemberFollow this tutorial so you can understand how to do this dynamically.
August 15, 2014 at 2:10 pm #119074DTHkellyMemberAugust 15, 2014 at 2:29 pm #119085Trish-chMemberGenwrock,
Thanks for your suggestion, I was actually trying to follow this tutorial but since section is just a tag and not a widget, I'm just not able to make it work.
August 15, 2014 at 2:40 pm #119094Genesis DeveloperMemberDon't create the widget. Your case it is not require. See this three lines
genesis_structural_wrap( 'pagetitle' ); genesis_structural_wrap( 'pagetitle', 'close' ); add_theme_support( 'genesis-structural-wraps', array( 'header', 'subnav', 'inner', 'footer-widgets','footer','pagetitle') );
This will give you the idea how the
genesis-structural-wraps
is working.
August 15, 2014 at 3:07 pm #119110Trish-chMemberThank you so much for your help, not sure how to apply this,
genesis_structural_wrap( 'section' ); genesis_structural_wrap( 'section', 'close' ); add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'section', 'footer-widgets', 'footer', ) );
not really working, how would you apply this concept?
I have also tried a different approach that seems to work but still only getting the wrap div after the first section and closed at the end of the entire site-inner, which is not what I want, maybe need to put it inside a loop or custom loop like for each section as sections kind of thing
add_action( 'genesis_before_content', 'section_wrap' ); function section_wrap() { echo '<section>'; genesis_structural_wrap( 'section', 'open' ); }
August 15, 2014 at 10:35 pm #119175Genesis DeveloperMemberYou can do this.
add_action( 'genesis_before_content', 'open_section_wrap' ); add_action( 'genesis_after_content', 'close_section_wrap' ); function open_section_wrap() { genesis_structural_wrap( 'custom-section'); } function close_section_wrap() { genesis_structural_wrap( 'custom-section', 'close' ); } add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'custom-section', 'footer-widgets', 'footer', ) );
August 16, 2014 at 1:25 pm #119236Trish-chMemberThank you so much I will give this a try.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.