Title: widgets plugin oddity
Last modified: August 18, 2016

---

# widgets plugin oddity

 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/widgets-plugin-oddity/)
 * I have an odd occurrence here. I’ve edited the functions.php file to change the
   LI tag listing of widgets to DIVs instead (per instructions for the plugin), 
   by adding this to the functions.php file:
 * `if ( function_exists('register_sidebars') )
    register_sidebar(array( 'before_widget'
   => '<div id="%1$s" class="widget %2$s">', // Removes <li> 'after_widget' => '
   </div>', // Removes </li> 'before_title' => '<div class="title">', // Replaces
   <h2> 'after_title' => '</div>', // Replaces </h2> ));
 * Basically, it changes the whole sidebar from being list items to each section/
   widget being placed within it’s own div – allowing for more styling flexibility.
   Which means that, when you “view source” for my page, the default layout for 
   widgets goes from this:
 * `<li id="archives"><h2>Archives</h2>
    <ul> <li><a href="#">Month 1</a></li> <
   li><a href="#">Month 2</a></li> </ul>
 * …to this:
 * `<div id="archives" class="widget widget_archives">
    <div class="title">Archives
   </div> <ul> <li><a href="#">Month 1</a></li> <li><a href="#">Month 2</a></li>
   </ul> </div>
 * ..which is exactly what I want.
 * However, for some unknown reason, the “blogroll” (or “Links”, as it’s known in
   the widgets adminsitrator area) will not convert to DIVs instead of LI’s. The
   LI and H2 tags (as shown in the first, default example) remain – no matter what
   I do. It’s only happening with the Links/Blogroll widget – none of the others
   have this issue.
 * Has anyone come across this problem before? It’s really annoying – it causes 
   my page to not validate, because it won’t place a UL prior to the LI tag…and 
   there’s no way to style it using CSS to remove the extra margins and padding 
   that are placed there for the rest of the stuff that’s working properly.
 * It just doesn’t make sense as to why it’ll DIV out every single widget *except*
   for the Links/Blogroll. Just curious as to why it’s doing this, and if there’s
   any way of fixing it.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Amie](https://wordpress.org/support/users/sunburntkamel/)
 * (@sunburntkamel)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/widgets-plugin-oddity/#post-398879)
 * i’ve been grinding this axe for a while.
    this is the code for the blogroll widget:`
   function widget_links($args) { // This ONLY works with li/h2 sidebars. get_links_list();}
   helpful, huh? kinda makes you wonder why they bothered writing an API at all.
   [this is my solution](http://www.archgfx.net/blog/index.php/2006/geek/wpw-linkslist),
   see andy’s comment for its limitations. you’re welcome to put the widget inside
   your functions.php file. you may want to add  unregister_sidebar_widget ( Links);
   to functions.php as well, to prevent accidents.
 *  Thread Starter [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [19 years, 11 months ago](https://wordpress.org/support/topic/widgets-plugin-oddity/#post-398880)
 * Thanks hon! I knew eventually someone would come along and know what was going
   on 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘widgets plugin oddity’ is closed to new replies.

## Tags

 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * Last activity: [19 years, 11 months ago](https://wordpress.org/support/topic/widgets-plugin-oddity/#post-398880)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
