Hi Everyone.
I am actually using wordpress as a CMS system.
I have found MANY cool code hacks on codex ??
I am replacing my cat pages using the standard wordpress cat-789.php example ??
So what I am looking to do is have a DIFFERENT single php show up on certain posts that are in a certain category.
@the above comment, YES, I do realize that I had single.php and On my server I had the code right.
I also understand that I need the loop but that is what the single1.pho and the single2.php are for,
So in a nut shell I want to use the above code to show a separate or different single php for the categories I code ( above code )
What I am trying to so is listed here
Query-based Templates
WordPress can load different Templates for different query types. There are two ways to do this: as part of the built-in Template Hierarchy, and through the use of Conditional Tags within The Loop of a template file.
To use the Template Hierarchy, you basically need to provide special-purpose Template files, which will automatically be used to override index.php. For instance, if your Theme provides a template called category.php and a category is being queried, category.php will be loaded instead of index.php. If category.php is not present, index.php is used as usual.
You can get even more specific in the Template Hierarchy by providing a file called, for instance, category-6.php — this file will be used rather than category.php when generating the page for the category whose ID number is 6. (You can find category ID numbers in Manage > Categories if you are logged in as the site administrator). For a more detailed look at how this process works, see Category Templates.
If your Theme needs to have even more control over which Template files are used than what is provided in the Template Hierarchy, you can use Conditional Tags. The Conditional Tag basically checks to see if some particular condition is true, within the WordPress Loop, and then you can load a particular template, or put some particular text on the screen, based on that condition.
For example, to generate a distinctive style sheet in a post only found within a specific category, the code might look like this:
<?php
if (is_category(9)) {
// looking for category 9 posts
include(TEMPLATEPATH . ‘/single2.php’);
} else {
// put this on every other category post
include(TEMPLATEPATH . ‘/single1.php’);
}
?>
Or, using a query, it might look like this:
<?php
$post = $wp_query->post;
if ( in_category(‘9’) ) {
include(TEMPLATEPATH . ‘/single2.php’);
} else {
include(TEMPLATEPATH . ‘/single1.php’);
}
?>
In either case, this example code will cause different templates to be used depending on the category of the particular post being displayed. Query conditions are not limited to categories, however — see the Conditional Tags article to look at all the options.
Thanks in advance!