I’m trying to widgetize a sidebar
The example code is:
<?php if (function_exists('dynamic_sidebar) || !dynamic_sidebar()) : ?>
<li>Stuff shown here if widgets are not active</li>
<?php endif; ?>
Using this method, it works!
I wanted to get a little creative and try something like this
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) { ?>
<li>Stuff shown here if widgets are not active</li>
<?php } endif; ?>
I keep geting Parse error!
What is wrong with my second example?
dsmIT
2
Perhaps reading this and [url=http://php.net/manual/en/control-structures.alternative-syntax.php]this makes things more clear.
If-statements are either encapsulated by { and } or by ‘if: … endif;’.
rpkamp
3
It’s either
if:
// some code
endif;
OR
if {
// some code
}
not a combination thereof
you have
if {
// some code
} endif;
rpkamp
4
You don’t, it’s already ended by the } in the last line

Thank you 
Sorry if this is a stupid question..
I’m supposed to end the if statement right?
So if i start an if statement like so:
<?php if ( this statement is false ) { ?>
// some code
//reason i'm doing it like this is just to experiment
<?php } ?>
How do i end the statement above?
Thank you 