Dalixam
Member
Posted 4 months ago #
Hi,
I want to style each widget individually, but they have no class or id. I use a template I made from scratch, but the widgets are added with drag-n-drop in the admin section, they are not hard coded.
When I look at the source with my own design it just says '<h2>Archives</h2>' for instance, but when I turn on the default design it is '<li id="archives-3" class="widget widget_archive"><h2 class="widgettitle">Archives</h2>'.
What am I missing for the widgets to get a class?
As a guess, you're missing... or something to that degree..
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
));
}
Dalixam
Member
Posted 4 months ago #
I feel stupid... I do have that function (otherwise widgets drag'n'drop wouldn't work), but I removed the
and <h2> a while ago because I didn't like the look and I forgot about it.
I'm a dumbass, but thanks for helping :)