Remove Genesis Structural Wraps from Markup

On Genesis themes, the structural .wrap is essentially an element which acts as a container for content. The sample and most of the themes have it set at 1140px wide and narrower at smaller sizes.

What areas have the .wrap markup  by default are:

  • header
  • menu-primary
  • menu-secondary
  • footer-widgets
  • footer

You can see this markup in the core Genesis framework at genesis/lib/init.php line 62-64

//* Maybe add support for structural wraps
 if ( ! current_theme_supports( 'genesis-structural-wraps' ) )
 add_theme_support( 'genesis-structural-wraps', array( 'header', 'menu-primary', 'menu-secondary', 'footer-widgets', 'footer' ) );

So the code is saying if the current theme doesn’t support Genesis Structural Wraps then add the support for the elements in the array.

So if you wanted to remove the .wrap lets say from the primary menu from your own theme you would add the theme support function without the menu-primary to your functions.php file.

6 Comments

  1. Lord on November 16, 2016 at 11:47 pm

    Thanks! It worked for the menu, but not the site-header. Any idea? Thanks!

  2. Deb on October 30, 2016 at 12:45 am

    Thank you for sharing the code.

  3. Ginger Coolidge on June 28, 2016 at 8:00 pm

    OK, this is too funny — I am writing a tutorial for a Genesis theme and I wanted to look up the definition for structural wraps. Who knew searching on the term would send me here, to my own comment almost exactly one year later!

  4. Ginger Coolidge (@gscoolidge) on May 25, 2015 at 3:47 pm

    Thanks for the post! Question — can you give an example of a use-case where you’d want to remove a structural wrap? What are the benefits?

    • Neil Gee on May 26, 2015 at 4:52 am

      One instance may be when you want full width segments on a page without being contained, meaning they go edge to edge of the viewport, in this case you can remove the .site-inner wrap, this would be beneficial in a page builder like Beaver Builder of if you were just hand coding it.

Leave all Comment