• 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 class to the sidebar div

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 › Design Tips and Tricks › add a class to the sidebar div

This topic is: not resolved

Tagged: Sidebar

  • This topic has 7 replies, 3 voices, and was last updated 12 years, 8 months ago by Jen Baumann.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • November 18, 2012 at 12:25 pm #562
    micharo
    Member

    How do I add a class to the sidebar div with the name of the specific sidebar displayed?
    <div id="sidebar" class="nameofthesidebar"></div>

    November 18, 2012 at 2:20 pm #570
    Jon Weiss
    Member

    What exactly are you trying to accomplish? Are you trying to modify the css of a sidebar on various pages?


    View My Site – Two W Media.com | I’m a Recommended StudioPress Customizer

    November 18, 2012 at 6:44 pm #629
    micharo
    Member

    I have a few different sidebars.  Some sidebars are used on many pages. In order to apply css on the sidebars, for example a background image, I want to address the specific sidebar directly. Therefore I try to add a class in the sidebar div with the name of that sidebar. I looked into genesis-structural-wraps but i think that is not the way to go.

    Any help appreciated.

     

    November 19, 2012 at 11:04 am #696
    Jen Baumann
    Participant

    Are you using simple sidebars?

    November 19, 2012 at 3:33 pm #732
    micharo
    Member

    On some projects I add sidebars with php code, on other projects I use simple sidebars. As far as I can see simple sidebars does not add a extra class to the sidebar div - with the sidebar name.

    perhaps there is a filter or so?

    November 19, 2012 at 3:42 pm #739
    Jen Baumann
    Participant

    It all depends on how you do things. There's more than one way to skin a cat, but if you do it this way, then it is easy to add a class to the sidebar markup.  As for Simple Sidebars, send me a message. I may have something for you to test.

    November 19, 2012 at 10:26 pm #795
    micharo
    Member

    Thanks for the reply.

    I will use it when I will do it with code. I don't know why I could not see that solution.

    Another question: Why are you using genesis_structural_wrap in your example on your site?

    Thanks again.

    November 20, 2012 at 7:53 am #819
    Jen Baumann
    Participant

    Basically, just to maintain consistency with the standard Genesis sidebar markup.  If you look at the Genesis sidebar.php, you'll see the same markup.

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2025 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