• I have a questions regarding the usage of the dynamic_sidebar function example as outlined in the WordPress codex.

    The code looks like this.

    <?php if ( !dynamic_sidebar( 'sidebar' ) ) : ?>
       <li>{static sidebar item 1}</li>
       <li>{static sidebar item 2}</li>
    <?php endif; ?>

    I understand that the dynamic_sidebar functions returns a stuff that either evaluates to true or false. If the function returns with false then the logical not operator switches it to true which then displays what ever is marked up between the if conditional.

    What I don’t understand is how the sidebar widgets and such get displayed if the dynamic_sidebar function returns true. The if statement is a conditional so how does it know to show the sidebar without adding and else clause calling the sidebar?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Regarding dynamic_sidebar function’ is closed to new replies.