• Resolved raskull

    (@raskull)


    My dynamic sidebar is encased in <ul></ul>.

    I have provided no default content if no widgets are present.

    Therefore, if the user has not dragged in a widget, the source outputs
    <ul></ul> and generates a xhtml strict validation error for unfinished business (it expects <li></li> encased therein).

    So the question is: Can I detect if a widget is present so I can write the <ul></ul> tags conditionally?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I have provided no default content if no widgets are present.

    Why not set the default content to an empty list element?

    eg.

    <li></li>

    Thread Starter raskull

    (@raskull)

    u rök

    <ul>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) {
    	echo '<li></li>';
    } ?>
    </ul>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘dynamic sidebar / conditional based on presence of widget’ is closed to new replies.