Displaying a Title Above a Category Page
I am trying to get a static title show above each category page in Atahualpa. I have found this solution on wordpress.org, however I am at a loss as to how to test it with Atahualpa as the theme doesn’t have category.php or archives.php. Here’s the suggested solution:
Different Text on Some Category Pages
A slightly more complex possibility is that you want different text to display depending on which category page the visitor is viewing. Then you would add the “default” text to the main category.php file, and create special category-#.php files (with their own version of the text, as described in the Introduction) for each category that needs special text at the top.
This does however create a lot of files in your theme directory, and can be avoided using the following code OUTSIDE the loop:
<?php if (is_category(‘Category A’)) : ?>
<p>This is the text to describe category A</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 endif; ?>
This does the following. Checks to see if we are looking at Category A, if we are then show the first bit of text, but if we’re not then check if we are looking at Category B. If we are then show that bit of text, and finally, if it is neither Category A or B, then show this default text.
I am hoping that someone has implemented this with the newest Atahualpa theme (the older versions allowed php. inserts using the theme’s options, but not any more).
Any ideas would be greatly appreciated!
- The topic ‘Displaying a Title Above a Category Page’ is closed to new replies.