Removing structural wraps

Community Forums Forums Design Tips and Tricks Removing structural wraps

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  Peter 8 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #82806

    Peter
    Participant
    Post count: 95

    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="site-container">, <div class="wrap"> in some areas, <aside> & <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?

    #82821

    Anita
    Blocked
    Post count: 7712

    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.


    Web: http://cre8tivediva.com / Twitter: @thecre8tivediva

    #82840

    Peter
    Participant
    Post count: 95

    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 .content-sidebar-wrap or .widget-wrap, etc?

    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.

    • This reply was modified 8 months, 2 weeks ago by  Peter.
    • This reply was modified 8 months, 2 weeks ago by  Peter.
    #82894

    Anita
    Blocked
    Post count: 7712

    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.


    Web: http://cre8tivediva.com / Twitter: @thecre8tivediva

    #82940

    Peter
    Participant
    Post count: 95

    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.

    #82947

    Peter
    Participant
    Post count: 95

    To be clear on that, this for example:

    remove_theme_support( ‘genesis-structural-wraps’, array(
    ‘header’,
    ) );

    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)

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

You must be logged in to reply to this topic.