Skip navigation

Show Just One Category in WordPress Categories

A challenge come up on the forum for a user who had a very interesting wish. When clicking on a category from the main page, he wanted a page showing the categories, but ONLY the categories from that category, not the children of the categories.

Let me explain this better. By clicking on a link from either the main page sidebar or a category link under a post title (or anywhere a category link is), if the category you are visiting has any subcategories, they will not show up on the displayed category list. Only the posts within that category will appear.

A very neat trick. But unfortunately, not an easy answer to solve because it goes against the normal use of WordPress tags.

Enter MDAWaffe, the same delightful programmer who solved my Creating Multiple Single Posts for Different Categories problem.

He wrote a new plugin that will:

This plugin will cause WordPress to display on a category archive page only those posts which are direct members of that category, i.e. this plugins will exclude from that category page all posts which belong to any of that category’s subcategories but do not belong to the category itself.

The plugin is called Just One Category, for displaying only one category on a category page for all your categories, and looks very easy to use.

This is not a fix for everything. If you want to control how each category looks, they check out the WordPress Codex documentation article, Category Templates - Writing Custom Category Templates, also by the same brilliant MDAWaffe.

It’s wonderful how many ways there are to control and change the results of your WordPress site.

2 Comments

  1. Posted June 7, 2008 at 1:22 am | Permalink

    Do you know of any blog editor (or plugin for same) that will allow me to post to multiple blogs at the same time? Some of my posts have significant overlap and it would be nice to write once / upload once / post twice (or more).

  2. Posted June 7, 2008 at 3:36 pm | Permalink

    @ BillinDetroit:

    No, I don’t know of such a Plugin and I would not support one if there was one. If your post content overlaps and you post to multiple blogs with the same content, you are risking penalties for duplicate content from Google’s PageRank.

2 Trackbacks/Pingbacks

  1. [...] Show Just One Category in WordPress Categories [...]

  2. [...] Show Just One Category in WordPress Categories [...]

Post a Comment

Your email is never published nor shared.