Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End conditional PHP in wordpress theme Re: conditional PHP in wordpress theme

#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;

When using the brackets…

Code:
id($foo == $bar){
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: