echo conditional tag depending on conditional tag?
-
Is it possible to echo php code, depending which page you are on. I do not want to echo a whole block of text but only a conditional tag which is wrapped around my loop.
This is the conditional tag that I want to print, but only, if I am on the home page:
<?php if (!(in_category(‘6’)) ) { ?>THE LOOP<?php } ?>
How do I do this? Do I simply put my conditional tag in an if statement like so:
if (is_home()) {
echo “if (!(in_category(‘6’)) ) {“;
}THE LOOP
if (is_home()) {
echo “}”;
}Or do I have to do it another way?
Thanks dl33
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘echo conditional tag depending on conditional tag?’ is closed to new replies.