I have this category-newbie.php template in my theme. And I have the category "newbie" in categories, but it is not using newbie it is using the category.php
EDIT:
So I actually solved this and forgot to write my solution.
So in my wordpress directory structure I have a categories directory. So I was putting my custom category template there. Apparently wordpress uses that categories directory for the built in categories or something and doesn't check it for custom ones. I just added my custom-slug.php to the root of the theme and it works.
I dont really like it personally because it doesn't seem to organize, but they may have their reasons for that.
Since you are having so much trouble, here is a band-aid solution. There is nothing wrong with this solution it just isn't as handy as simply using the WordPress template hierarchy and renaming the file.
Have a look at is_category()
.
Something like this:
<?php
$newbieID = 1; // put the ID for the Newbie category
if( is_category($newbieID) ) {
// Put template code here for Newbie
} else {
// Put template code for all other categories
}
?>
You will likely have to include this in both the category.php
and archive.php
template files.
category
, or is it a term from a custom taxonomyCategories
tab in the back end?category-ID.php
. Where the ID is the ID # of the category. To find the ID, click to edit the category Newbie (Dashboard > Posts > Categories > Newbie), you'll see the ID in the URL, for example:...tag_ID=15...
,category-15.php
.