Is this your first time here?     About this blog   |    About my company, PressDev   |    WordPress Tune-Up

Today I learned about category templates in WordPress. There is a simple, yet rarely used feature, that allows you to display content based on a specific category. For example, if you have 10 categories, with ID’s 1-10, and you want to show your visitors something different for each of these 10 categories, you can create files with this naming convention:

category-1.php, category-2.php, and so on.

When the URL http://mydomain.com/category/coolcat is entered into the browsers address bar, and WordPress sees a category request made, it looks for a category-x.php file in the main template folder. If one exists, that will be used over the default template file. If a template file isn’t found for the requested category, the next file that WordPress looks for is category.php. This is another template default file that can be applied to all categories that don’t have their own template. If a category.php isn’t found, then the default template file is used.

One thing I discovered while trying to get category templates to work, I was entering http://mydomain.com/coolcat and expecting the category template to display. But as you may know, WordPress was trying to find a Page named “coolcat”. I struggled with this for a week, and after ripping out the small hair follicles on my head, it dawned on me I was entering the wrong URL. Remember, /category/ must precede the category name, or it just doesn’t work.

Here is a link to the WordPress Codex explaining category template.

Popularity: 6% [?]

{ 2 comments }

Kindle Is Convenient But Not Always The Best Choice

May 20, 2009

I know that’s a bold statement, not cost affective. Why am I saying that? Let’s look at a few things. Utah author Brandon Sanderson (who, by the way is finishing Robert Jordan’s Wheel of Time series), has The Well of Ascension (Mistborn, Book 2) for sale on Amazon in paperback for $7.99. The Kindle [...]

Read the full article →

Now You Can Access Google Tasks In Mail, Calendar and Mobile Applications

May 13, 2009

Finally, Tasks are part of the Google calendaring application. The Task feature has been available for a while now, but it wasn’t available as part of the calendaring system, where I believe most people want and need to use a task management system.
As is typical with Google, it’s not a flashy part of the calendaring [...]

Read the full article →

The Importance Of People Versus Technology

April 1, 2009

People are where it’s at. Technology is just a vehicle.
Today is April 1st. Typically people see today as the start of Spring. A time to renew. A time to access our plan for the year, and make some course corrections.
PodCampSLC 2009 just wrapped up a few days ago. Having the opportunity to meet people I [...]

Read the full article →

Google Offers Mobile Friend Finder With Latitude Service (But Not For The iPhone)

February 4, 2009

Google pushed out a new product today called Google Latitude. It basically lets you find friends in geographical locations via Google Maps. This is pretty cool. Loopt has been doing this for a while, and so have others. I’m not really sure I see the value in this, other than its a great way to [...]

Read the full article →