Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Make a Website with WordPress WordPress Widgets and Custom Menus How to Create Widgetized Areas in WordPress

If no dynamic sidebar?

if( !dynamic_sidebar( 'uptop' ) );

What is this line of code saying exactly?

If there is no dynamic sidebar 'uptop' then do what? I've never ever seen a conditional end with a semicolon. I know the brackets are there so PHP will know where the code block begins / ends.

http://codex.wordpress.org/Function_Reference/dynamic_sidebar It says in the documentation that dynamic_sidebar function returns a boolean true / false.

Thank you,


1 Answer

I think I might've figured out some of it. This basically goes to say don't output any widget area if dynamic_sidebar returns false. The semicolor caught me off guard because I've never seen that before but it just terminates the statement.

Am I correct?