I have been trying to freshen up and clean my design a bit, and wanted to slim down all the references to “widget” in the CSS class definitions in the dynamic sidebar. I found an excellent article on opensourcemaven detailing how to do this.
Basically you override the function call in the dynamic sidebar that registers your sidebars, and modify the default values. so that you keep modifications within your own theme directory so as not to mess with the default code.
Example code:
<?php
if ( function_exists('register_sidebar') )
register_sidebars(2,array(
// Removes <li> with class declaration
'before_widget' => '<li>',
// Removes </li> with class declaration
'after_widget' => '</li>',
// Replaces <h2> with class declaration
'before_title' => '<h3>',
// Replaces </h2> with class declaration
'after_title' => '</h3>',
));
?>
No related posts.
excellent, not only exactly what I was trying to remember how I did the first time, but the first google hit.
thanks.
but how if we use a div tag before widget started ? help me, I am trying to modify my current themes.
hmm - have you tried copying one of the <li> lines and replacing with <div> other than that I’m not sure really!