Using body_class() to get multiple themes on one blog
-
So I read HERE that it is possible to use the body_class() system to style specific pages.
Based on their CSS code I assumed it was as easy as changing:
#header { origianl css for header here }
into
body.page-id-90 #header { this is the new css header for JUST page-id-90 }
I assumed that you could have both of these CSS ID’s in the same CSS file and doing this for the entire original theme, you could then customize all of the fields with body.page-id-90 so that the page with page-id-90 would look completely different from all other pages.
If thats the case, can someone give me a working example of what this code would look like for the restyled “body” tag? For instance, the theme has the following CSS:
body { margin: 0; background: #ffffff; }
so would the page-id-90 version look like this?
body.page-id-90.body { new style here }
or do I need to put an ID in the body tag as well so I can call it like:
body.page-id-90 #body { new style here }
Whats really confusing is that the body element will have a class tag that is filled with a long list of classes and yet I don’t think I should add them recursively. For instance I wouldn’t put:
body.page-id-90 body { new style here }
because the body tag actually looks like this on the new page.
<body class=”page page-id-90 logged-in”>
Please someone explain how I can use this new styling approach to ensure that my page-id-90 is completely customizable.
Thanks in advance!!
- The topic ‘Using body_class() to get multiple themes on one blog’ is closed to new replies.