Per-page CSS, or STYLE tags allowed for users who have bought CSS Upgrade
-
Is there any reason why a user who’s bought the CSS Upgrade shouldn’t be allowed to use the STYLE tag?
Just wondering. It would save me a lot of work if I could do this.
The blog I need help with is: (visible only to logged in users)
-
why would you want to use a style tag if you can code your style sheet? Besides, using a ‘style’ tag would required you to insert it inside the “head” tag which is not possible at wp.com… to insert “style” tags would required you to have access to the .php files and that’s not allowed here because the same .php code you use is used by other members using the same theme as you.
-
Fundamentally, what I’d like is to be able to customize an HTML widget per page. The closest I can come to this is per-page styles. That could be through the STYLE tag, or additional style sheets loaded on a per-page basis.
If I were able to do this, I could use the style sheet to say, “Display all elements with a class id corresponding to the current page and style them like this…” with just a couple of lines of code that I would never have to change, no matter how much I ended up adding to the HTML widget.
-
Sandbox would allow you to do that. It adds classes to the “body” tag that would help you achieve what you want without the need of adding a “style” tag…. all you need to do is define everything in you CSS Style Sheet.
-
In this particular case, Sandbox wouldn’t work, because I need to be able to get at deep hierarchies of pages, and Sandbox doesn’t drill deep enough. Sandbox’s rich semantics don’t help me if the rendered HTML doesn’t have the information I need to display.
Hence, I need an HTML widget which will definitely contain the information I want, and which can be easily tweaked per page with a little CSS.
-
Of all themes available here, Sandbox would be the best alternative… but if the default markup is not helpful, then you’d need to write the hierarchies yourself in a text widget, and assign their classes yourself, then define those classes in your CSS. Still Sandbox would help you a lot achieving this even though the hierarchies are written manually by you.
-
It’s not clear how Sandbox helps me with customizing the appearance of the text widget per page. How would that work?
-
Sandbox adds unique class values to the “body” tag. For example, a page would have this in its body tag:
<body class="wordpress page pageid-2 loggedin">Notice the “pageid-2” class value; that would be very helpful to style your widgets per specific pages.
Say you write this in a text widget:
<ul class="myclass"> <li>item 1</li> <li>item 1</li> <li>item 1</li> </ul>Then in your CSS your selectors could look something like this:
.pageid-2 .myclass{ [your properties here] }You could take it from there.
-
If you want to leave the default classes of your widgets (not just text widgets) then you’d do it like this:
.pageid-2 .whatever_widget_class{ [your properties here] } -
Okay, I get it… I was hoping for something semantically richer, but I guess I’m just lazy.
Thanks.
- The topic ‘Per-page CSS, or STYLE tags allowed for users who have bought CSS Upgrade’ is closed to new replies.