Home › Forums › Back End › conditional PHP in wordpress theme › Re: conditional PHP in wordpress theme
April 4, 2010 at 3:52 am
#73421
Makeshift
Member
Alright, a few problems here.
I see you’re using the colons ‘:’ and the brackets ‘{‘ ‘}’.
You can’t use both on the same statement.
When using the colons, here is how it would go…
Code:
if($foo == $bar):
do_someting();
elseif:
do_something_else();
endif;
do_someting();
elseif:
do_something_else();
endif;
When using the brackets…
Code:
id($foo == $bar){
so_something();
}else{
so_something_else();
}
so_something();
}else{
so_something_else();
}
So, in this particular code, this isn’t your only problem…
When using these statements as you are, it’s best not to echo the codes…
Code: