Community Forums › Forums › Design Tips and Tricks › add a class to the sidebar div
Tagged: Sidebar
This topic contains 7 replies, has 3 voices, and was last updated by Jen Baumann 5 months, 4 weeks ago.
-
AuthorPosts
-
November 18, 2012 at 12:25 pm #562November 18, 2012 at 2:20 pm #570
What exactly are you trying to accomplish? Are you trying to modify the css of a sidebar on various pages?
November 18, 2012 at 6:44 pm #629I 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 #696Are you using simple sidebars?
Jennifer “Hermione” Baumann | Recommended StudioPress Developer
Dream Whisper Designs | Themessence | @dreamwhisper | If I’ve helped, like me on FacebookNovember 19, 2012 at 3:33 pm #732On 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 #739It 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.
Jennifer “Hermione” Baumann | Recommended StudioPress Developer
Dream Whisper Designs | Themessence | @dreamwhisper | If I’ve helped, like me on FacebookNovember 19, 2012 at 10:26 pm #795Thanks 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 #819Basically, just to maintain consistency with the standard Genesis sidebar markup. If you look at the Genesis sidebar.php, you’ll see the same markup.
Jennifer “Hermione” Baumann | Recommended StudioPress Developer
Dream Whisper Designs | Themessence | @dreamwhisper | If I’ve helped, like me on Facebook -
AuthorPosts
You must be logged in to reply to this topic.