I’ve five different if statements in The Loop of my main index.php that make use of the conditionals, all without problem. Would help in debugging to know what the errors are you’re seeing.
And we’re all about rubbish here!
Thanks, I should be ok now I’ve found some sample code to work from. Basically I had no idea how to use functions inside an echo, and that’s what was causing the difficulties.
(Please consider adding your example of use within the loop to the codex! There may be others like me who assume from the current page that conditional tags are designed exclusively for sidebars.)
“Please consider adding your example of use within the loop to the codex!”
Will do.
Once more I have overestimated my abilities and cannot, in fact, get the sample code to work either. I get a ‘Parse error: unexpected <‘ the line after the conditionals end.
To my eye it looks slightly odd that there’s no closing ?>
to finish off the conditional statements, but maybe that’s how it’s supposed to be? In any case, when I add one I get ‘unexpected $end’ on the last line of the template.
That’ll teach me for trying to show off. I just wish month.php had existed after all, it would have saved me a lot of frustration.
The example code on Codex did have a missing closing PHP tag. I’ve corrected it.
Showing off is still acceptable…