• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add a containing div to a page template

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Add a containing div to a page template

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 13 years, 7 months ago by RobCubbon.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • March 21, 2013 at 10:18 am #29967
    RobCubbon
    Member

    Hello, I would like to add a containing div to a page template.

    So, say I have a page template called "front.php"

    This gives me the first two body lines of HTML like so :

    <body class="home page page-id-8 page-template page-template-front-php logged-in header-image header-full-width full-width-content">
    <div id="wrap">

    And I would like them to be :

    <body class="home page page-id-8 page-template page-template-front-php logged-in header-image header-full-width full-width-content">
    <div id="main-image">
    <div id="wrap">

    (and, obviously, close that main image div at the end before the closing body tag).

    How do I do that?


    Rob Cubbon

    March 21, 2013 at 5:08 pm #30322
    David Chu
    Participant

    Hi There, Rob!
    That's a good question, and I had to think about it. Although I like to do nearly everything with hooks and filters... ๐Ÿ™‚

    For this, I think you'll want to copy header.php and footer.php from the /genesis folder into your child theme. Then open up those beauties, and in there you'll see where you could code in what you're describing. I believe that should take care of it.

    Truthfully, most of the time I'd probably find a way to manage this purely through CSS without the extra HTML. Just as I enjoy hooks, I prefer not to play with any template files when I can avoid it. And there may be other structural hooks lying about that I haven't run across yet. Some super theme geek might chime in on that, or a question about that to tech support might bear fruit.

    But your way is certainly a viable alternative, I'm quite sure. I think the only pitfall for that is if the next version of Genesis comes out with brand new structures for the header and footer, which is possible with the advent of HTML5 in Genesis. So you'll want to keep your eye on that.

    Do let me know how you make out.

    Best, Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

    March 23, 2013 at 7:22 am #30658
    RobCubbon
    Member

    Thank you, Flamenco, I'd forgotten about putting files from the framework into the child theme. Although, as you say, it's not entirely future proof, it works!!!

    I'd forgotten to say why I wanted to do this: http://www.lynashworth.co.uk/ – it seems the only way to get this background image effect to work. But I may be wrong.

    Yes, filters, hooks and CSS are the best ways to achieve what you want with Genesis ... if you know how!!! ๐Ÿ™‚

    All the best, Rob


    Rob Cubbon

    March 24, 2013 at 4:41 pm #30981
    David Chu
    Participant

    Rob,
    I'm glad that worked! It's true, sometimes one can only get the result one wants by changing markup. In fact, I suppose if that weren't true, then the web would be more boring, with everything having the exact same format.

    In any case, if either of us were going to make the leap to Genesis 2, we'd do a backup anyway. ๐Ÿ™‚ And many people, as we saw during the 1.9 update, didn't bother, and got spanked.

    Best, Dave


    Dave Chu ยท Custom WordPress Developer – likes collaborating with Designers

    March 26, 2013 at 3:32 am #31262
    RobCubbon
    Member

    Indeed!


    Rob Cubbon

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble