Title: is_dynamic_sidebar
Published: April 25, 2014
Last modified: May 20, 2026

---

# is_dynamic_sidebar(): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#wp--skip-link--target)

Determines whether the dynamic sidebar is enabled and used by the theme.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#description)󠁿

For more information on this and similar theme functions, check out the [ Conditional Tags](https://developer.wordpress.org/themes/basics/conditional-tags/)
article in the Theme Developer Handbook.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#return)󠁿

 bool True if using widgets, false otherwise.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#source)󠁿

    ```php
    function is_dynamic_sidebar() {
    	global $wp_registered_widgets, $wp_registered_sidebars;

    	$sidebars_widgets = get_option( 'sidebars_widgets' );

    	foreach ( (array) $wp_registered_sidebars as $index => $sidebar ) {
    		if ( ! empty( $sidebars_widgets[ $index ] ) ) {
    			foreach ( (array) $sidebars_widgets[ $index ] as $widget ) {
    				if ( array_key_exists( $widget, $wp_registered_widgets ) ) {
    					return true;
    				}
    			}
    		}
    	}

    	return false;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/widgets.php#L953)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/widgets.php#L953-L969)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#related)󠁿

| Uses | Description | 
| [get_option()](https://developer.wordpress.org/reference/functions/get_option/)`wp-includes/option.php` |

Retrieves an option value based on an option name.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/is_dynamic_sidebar/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fis_dynamic_sidebar%2F)
before being able to contribute a note or feedback.