Archived topic
Adding Custom body_class to Specific Layout
3 replies · Started by Gilad Gafni on March 23, 2022
I'm looking to add a body_class to a specific Layout Element.
Similar to the solution displayed here -
https://generatepress.com/forums/topic/custom-classes-on-elements-layout/
But with the condition being whether or not the current page is using a specific layout.
Thanks!
Hi there,
What specific layout are you referring to here?
I have 2 layout elements.
In layout 1, I would like to have -
.header-wrap .inside-header { margin-top: 40px; }
In layout 2, I would like to have -
.header-wrap .inside-header { margin-top: 140px; }
My thought was to have a unique body_class to each layout and use style it that way, but maybe there's a different way?
What is the logic/condition behind the two layouts?
Can you provide the links to the specific examples?
Thanks!