Three clients have recent had me working (and thinking about) category pages. These are the pages that list every post within a certain category. So, for example, you might have a list of articles on a category page, and from this page, you can click and visit the post in that category.
In two cases the clients need staff listings. For one client, I created a custom content type – this gives you more control over how you enter all the information in the content form. Custom content types are very handy for having boxes of fields that will match your content. So, for example, there is a field for telephone, one for office and one for email.
As I wrote last spring and summer about images, perhaps I will have a series on category pages. Stay tuned for more this fall on this topic!
What is a Category Page?
When talking about WordPress, a category page is a page with links to all posts in a certain category. As an example, here is a category page on this blog for WordPress. WordPress themes provide the default category page, often seen as archive.php.
In Drupal, you can create and format a page that is a list of links to a certain content type, be it articles, stories or some custom content type. One would typically do this with Views. But as most of my readers are using WordPress, I will use the rest of this post to explain how one can create a custom category page with WordPress.
What Can One do to Customize a Category Page?
If we go back to my previous example, you will see on my WordPress Category Page that for each listing I have the title, the author of the post, an excerpt, links for the categories and tags of the posts and a thumbnail that floats to the right of the rest of the content. But that’s just one example. On my Sketching Out blog, if you look at my category page for recipes, you will note I have a painting at the top and tag links right below it. Then I have the recipe post listing as usual.
Back to the clients who need staff listings: basically, the category page will be a list of the staff. Ideally, it is nice to have photos of each staff member on the staff listing page. You will probably want the name as well. Then you have to decide what other information is most important: title? phone? email? Or is just the name and photo linked good enough?
Before getting into how to code a category page, here is yet one more example. I do try to write about New Jersey (where I live), especially Central New Jersey. On my category page for New Jersey, I have a sentence and a link to a page of New Jersey Twitter users.
What would you want to include on a category page? Something special at the top? A thumbnail image for each post? An excerpt? Let’s learn how in the next section.
How can one Customize a Category Page with WordPress?
This does involved some coding, but if you have a webmaster who can do coding, this is really some of the simplest coding there is. The way to make any changes to a category listing (without using a plugin) is taking the default, which is probably archive.php or category.php and bit of code to it. If you are afraid of code, just skip this section – you can either hire someone to do this or find a plugin that does the bit that you need.
If you want to change every category page, then make edits to category.php (if you aren’t using a theme specific to your site, you might want to make the category.php in what is called a child theme). If you just want to change one particular category, you could create a category-slug.php page (with the slug being the name of the category, with no capitalization). To find the slug for your category, go to your Dashboard and pick Posts->Categories. If you click on the edit link under the category that interests you, you will see the category slug. More on Category Templates on the WordPress Codex.
So here is an example of how to add a thumbnail image to every post on a category page. First, on every posts in your category, add a Featured Image. Make each image the same size for consistency. A good size for a thumbnail might be 100px wide by 100px high. Or maybe you want bigger: 200px wide by 150px high. The important point is choose one size and stick with it. So what then is the code to add the thumbnail to this page? If you scroll down on the Post Thumbnails page in the WordPress Codex, the first example has the code.
If you just want certain text at the top of a certain category page, you would just need to put the text at the top of the category-slug.php page before the loop that gets all the posts in that category begins. If you wanted to be able to edit the text yourself easily, then it gets a little trickier. Ask your webmaster to include that text in a post or in a custom content type; then you can edit it as you do other posts, pages or articles.
Over to You and Your Ideas and Reactions
This post is to get some ideas flowing about what one might do with the category pages. While there are some plugins, the first one I looked at had not been updated since May 2013 (that means do not use it – too old). Please know that custom category pages involve simple coding, so if you have specific ideas about what you need, for example, on a staff page, a good web developer should be able to write simple code to help you out (and best to do this to a child theme).
If you had the opportunity, what you would you add to a category page? A thumbnail? An excerpt? A special image at the top? Have you seen any interesting category pages?