• cscott5288

    (@cscott5288)


    OK, so I am right now in the process of widgitizing me new wordpress theme.

    I’ve got an area at the footer where I want to be able to place widgets. I styled the ul and li for the area but did so within a divider. So if I take the individual divs out of each ul in the footer, the theme messes up.

    I understand that the dynamic sidebar (widget php tag) only inserts ul and lis NOT divs. Does this mean I have to re-style my uls so that they work without each having an individual div?

    I am pretty sure I have to but I want to make sure … for curiosity’s sake. Thanks ..

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

    (@alchymyth)

    I understand that the dynamic sidebar (widget php tag) only inserts ul and lis NOT divs.

    not generally; you can influence that with your widget declaration in the functions.php of the theme:

    https://codex.www.ads-software.com/Function_Reference/register_sidebar

    <?php $args = array(
        'name'          => sprintf(__('Sidebar %d'), $i ),
        'id'            => 'sidebar-$i',
        'description'   =>
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>' ); ?>

    you can set divs instead of lis in your footer ‘sidebar’ (and start with a div instead of ul).

    the reason why so many widgets and dymnamic sidebars use ul/li is because many wordpress functions output lists – the wp_list_pages() for instance and the wp_list_categories() as well, and more.

    Thread Starter cscott5288

    (@cscott5288)

    Thanks. This makes sense.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I do this?’ is closed to new replies.