Simple PHP question on if/else statements
-
Hi guys,
I instelled WordPress Custom Field Template and I use getCustomField(‘name’) in order to get the value I need.
I’m working on an if/else statement, but it doen’t work.
<?php $condition = getCustomField('Show date'); if ($condition == 'yes') { the_date(); } else { echo "Nothing interesting to show."; } ?>
But this function doesn’t work. $condition is empty if I echo it and the result is “yesNothing interesting to show”, like it prints the getCustomField function instead to keep it into the variable.
How can I do?
Thanks in advice.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Simple PHP question on if/else statements’ is closed to new replies.