Wordpress - "Outside the Loop"
Anyhow, I want to add a different block of text at the beginning of each category page in a Wordpress blog. The instructions for this are:
"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 } ?>"
I've Googled to no avail, but can't figure out how to accomplish this. What does 'outside the loop' mean? Is there a plug-in that will do this? Are there instructions "for dummies"?
-
Tim Dixon -
[ 1 ] Thanks
{{ DiscussionBoard.errors[277885].message }} -
-
liban -
Thanks
{{ DiscussionBoard.errors[278085].message }} -