Category Template…
-
I searched but couldn’t find a solution.
Here is the code I’m using, taken from the WP docs:
<?php if (is_category('429')) { ?><p> We realize that some of the Newsstand links are to papers which require you to subscribe to their paper as well. They are not part of HHR.</p> <?php } ?>
I have checked the category ID, and it’s accurate. That code is on single.php in my theme, so every time my user clicks on a post in that category, the above shows up.
I know it’s the right file…well…because I’m familiar with what single.php produces within my theme. I also know it’s the right file because when I post the whole code…
<?php if (is_category('429')) { ?><p> We realize that some of the Newsstand links are to papers which require you to subscribe to their paper as well. They are not part of HHR.</p> <?php } elseif (is_category('Category B')) { ?> <p>This is the text to describe category B</p> <?php } else { ?> <p>This is some generic text to describe all other category pages, I could be left blank</p> <?php } ?>
…it bypasses the “if” and “elseif” and just prints the “else”-> This is some generic text to describe all other category pages, I could be left blank.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Category Template…’ is closed to new replies.