Conditional statement to exclude certain text from index.php
-
Hi,
I have put some static text on my homepage that appears before the loop actually starts.
However, when I want to display posts from a certain month or certain category, this introductory text is somehow in the way of the reader.
I’ve already searched this forum and found a nice solution.
I’ve used the following code before the introduction
<php if (!$monthnum || !$cat) { ?>
Text
<?php } ?>
However, it doesn’t seem to work. If I have only one statement (say, !$cat only), everything works fine. It seems that the conditional statement is wrong, although I don’t really see why. It’s valid PHP, isn’t it?
Anyone’s got an idea how I can solve this? It should work the way I used it, but it’s not. Any ideas appreciated.
Thanks,
T.
- The topic ‘Conditional statement to exclude certain text from index.php’ is closed to new replies.