In the codex example of displaying sidebars, what is the significance of the conditional wrapping around the call to dynamic_sidebar? Why do this:

<?php if ( dynamic_sidebar('example_widget_area_name') ) : else : endif; ?>

this seems to work ok:

<?php dynamic_sidebar('example_widget_area_name'); ?>

Thanks,

Toby

1 Answer
1

To quote the Codex

The return value should be used to determine whether to display a static sidebar. This ensures that your theme will look good even when the Widgets plug-in is not active.

So essentially you can use is to display other content if the user has not activated any widgets in the sidebar.

Leave a Reply

Your email address will not be published. Required fields are marked *