Title: Regarding   dynamic_sidebar function
Last modified: August 20, 2016

---

# Regarding dynamic_sidebar function

 *  [central101](https://wordpress.org/support/users/central101/)
 * (@central101)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/regarding-dynamic_sidebar-function/)
 * 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)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/regarding-dynamic_sidebar-function/#post-3212370)
 * [http://codex.wordpress.org/Function_Reference/dynamic_sidebar](http://codex.wordpress.org/Function_Reference/dynamic_sidebar)
 * > This function calls each of the active widget callbacks in order, which prints
   > the markup for the sidebar.

Viewing 1 replies (of 1 total)

The topic ‘Regarding dynamic_sidebar function’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/regarding-dynamic_sidebar-function/#post-3212370)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
