Tagged: remove html wrap structure
Call me a neat freak, but I want keep my HTML as lean as possible. There are some <div> wraps (and some other tags) that won’t ever be used for my site (e.g.,
<div class="wrap"> in some areas,
<section> wraps in the header widget area when it’s only being used for a
<nav> menu, etc.) http://www.genesisframework.com/markup.php
Is there a code snippet to remove the unused <div> wraps of my choosing… or is there a reason this would be a bad idea?
Look in your functions.php file. I know some themes have “support for structural wraps” included in there and I believe you can remove what you don’t want/need.
It’s not in there, but I looked here http://my.studiopress.com/snippets/structural-wraps/ and tried:
remove_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'site-inner', 'footer-widgets', 'footer' ) );
But I can’t find documentation on what exactly qualifies as a “structural wrap”, or a list of all elements that have “structural wraps”. I’m assuming it only removes <div class=”wrap”>. But what about
Edit: Actually, the above code looks like it removes all theme support for “structural wraps”, even if I don’t list those items in the array. So that doesn’t work for me, I only want to remove the wraps that I’m not using.
You can remove a line out of that code. You do not need to remove the entire code. For example, say you created a new widget area called Home-Top – you could give Home Top a “wrap” of it’s own and then customize that wrap specifically for Home Top. You would add “home-top” to that code to include it in the structural wrap.
That code isn’t included in my functions.php. I just took that snippet and changed add to remove to test if that would work. I can’t specify from which section I want wraps removed; It just removes all structural wraps.
To be clear on that, this for example:
remove_theme_support( ‘genesis-structural-wraps’, array(
doesn’t just target and remove the wrap inside the <header>. it removes <div class=”wrap”> from all elements on the page (some of which I may need)
You must be logged in to reply to this topic.
Are you a blogger, web designer, developer, or website owner looking to generate more income?
Promote products for the largest and fastest growing online website platform as part of our affiliate program.