with Lorelle and Brent VanFossen

WordPress Plugin – Just One Category

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.

3 Comments

  • WordPress › Error

    There has been a critical error on this website.

    Learn more about troubleshooting WordPress.