I'm attempting to style lists in the sidebar (you know, <ul><li>
) and I'm curious how to also make widgets adopt this class. Each widget seems to have its own class assigned to it by WordPress' defaults - is there a way to override this?
As alluded to by @Michael in the comments, the CSS classes for widgets depend on the sidebar they're in more than the widget themselves. Those widget-specific CSS classes can be useful, but not when you're trying to style every widget. It sounds like you may be able to use a normal element selector that targets anything in your sidebar, though I'm unclear exactly what you need. Assuming your sidebar wrapper had an id of "sidebar" you'd use something like this:
However, this may not work if you don't have a sidebar wrapper or need something more or less specific. This brings us back to
The line to focus on is this one:
Notice two things:
It sounds like you're wanting that "widget" class mentioned in point 2 above. Then you'd use a nicer CSS selector like
If that's what you need, you'll need to change the way your theme registers that sidebar and probably use that |
|||
|
register_sidebar()
in functions.php – Michael Apr 29 at 15:05register_sidebar()
code in your question. – Chip Bennett Apr 29 at 15:25