• 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

custom div class

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 › custom div class

This topic is: not resolved
  • This topic has 5 replies, 2 voices, and was last updated 9 years, 6 months ago by smenegassi.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • August 5, 2016 at 9:50 am #190784
    smenegassi
    Participant

    Hi,

    I am working on a theme.
    I want the create a div with a class under site-header so to apply a background image to this new div, let’s say .site-header-image. How can I do that ?

    Thanks for any cue.

    s.

    August 5, 2016 at 11:16 am #190791
    Genesis Developer
    Member

    EDITED:

    add_filter( "genesis_markup_site-header_output", "gd_add_new_div", 10, 2 ); 
    function gd_add_new_div( $tag, $args )  {
      return $tag . '<div class="site-header-image">' . "\n";
    }
    
    add_action( 'genesis_header', 'genesis_header_new_div_markup_close', 16 );
    function genesis_header_new_div_markup_close()  {
            echo '</div>' . "\n"
    }

    Add this code in your functions.php file.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 5, 2016 at 8:16 pm #190810
    Genesis Developer
    Member

    Change the priority 16 to 14.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 6, 2016 at 1:50 am #190819
    smenegassi
    Participant

    Hello,

    Thanks for your answer. I've tried but I get a white page....
    s there a documentaion on "genesis_markup_site-header_output" ?
    Thanks,
    s.

    August 6, 2016 at 2:29 am #190820
    Genesis Developer
    Member

    Sorry I missed the ';'

    Replace

    echo '</div>' . "\n"

    With

    echo '</div>' . "\n";


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    August 6, 2016 at 3:06 am #190822
    smenegassi
    Participant

    I should had thought of it ! Thanks. It is there !
    I'll have to study this solution. Thanks a lot again.
    s.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 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