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.


  • Posted October 12, 2005 at 21:08 | Permalink

    Hi Lorelle,
    I am so happy to have found your site, unknowingly you’ve help me a lot. Following a rather fast decision my daughter went travelling, as a surprise so we and the acquaintances she makes can a bit follow her discoveries I’m building her a blog. I’m flirting with php and just got introduced to the blog world. So to make the story shorter WordPress fell on my laps and as you mention often it is a very powerful tool. I do have some peeves with it and for a newbee I find some basic info missing.
    1) Kubrick theme as nice as it can be still (as a default) doesn’t show the ways around (no categories feature and a bunch of other feature missing as not to the liking of the author)
    If you take a look at my site you will find a page Voyages that should holds only post from the travel category (that works) but when I click on the Travel category I would like to have the posts listed per cat and subcat following the cat order, could you please guide me with this procedure?
    I went through hundreds of comments in the forums but didn’t find a clear procedure. This leads to my 2 peeve

    2) the forums are full of information but are those still relevant, does a solution for a nightly build v1.o… dated over 1 year still apply with version 1.5.2? I tried some but among my lack of knowledge and the possible outdated solution it doesn’t work.
    3) The Codex is very complete but one has to know most of the tags and their attributs to understand what is presented. For instance trackback and pings, about 5 lines for each, what should I do with them and how should I use them? I did click once or twice on them but nothing shows, I don’t even know what should happen. I too would prefer to have them separated from the comments following a post (just sounds logical) I tried to follow your setp through but then I can’t even find my way as I developed over the default theme. Where should I put the tags as indicated in Nooscope’s article. Also you are using Jerome’s keywords and added Ultimate Tag Warrior, why both aren’t they doing something similar?

    Sorry of the length of this comment, I shall stop here. I should have emailed you. Hoping you can help me and that I’m not taking too much of your time (as I did with the space) I am a bit lost. Best regards,

  • Posted October 12, 2005 at 23:22 | Permalink

    Wow, let’s see if I can tackle this fast.

    1. Kubrick sucks – try ANY other Theme. And it looks like you have.

    1A. >>>the posts listed per cat and subcat following the cat orderwp_list_cats and/or list_cats template tags. Either of these will work if you set the “children” parameter to “show”. There are examples there.

    2. The majority of everything in the WordPress Support Forum will work on 1.5+, so whether you have a nightly build or 1.5.2, it should work. There is TONS of information packed in that forum. If want you want is not there, ask.

    3. Trackbacks, pings, and all kinds of info is there in the Codex. It sounds like you started with the Intermediate stuff and skipped A, B, and C. Hit WordPress Lessons and New to WordPress – Where to Start to get a handle on some basic elements. And if you don’t understand some basic features like trackbacks and pings, take time to read through Introduction to Blogging.

    As for trackbacks, just leave them alone. They will happen naturally when someone links to that particular post in the future when the site is active and has something worth linking to.

    3A. Separating Trackbacks from Comments in WordPress pretty much explains it. Check the links in the article for more specifics. Most people do not separate them, but I wanted to. But it’s a pain in the butt to do.

    3B. I am using both Jerome’s keywords and Ultimate Tag Warrior AND Technorati Tags. They are different things and they do what they do differently. Keywords are NOT tags and tags are not keywords. You can see the plugins I use on my list of WordPress plugins page. I haven’t decided between Ultimate Tag Warrior and Technorati Tags, so I’m trying them both for now.

    4. Calm down. You are doing too much. Put the focus back on the content and stop tweaking and twiddling with the site. It’s lovely. Trying to make it do more than it does is only wasting your time right now. Get your daughter using it and make it fun for her to use, and if she thinks of something to improve, then dig into the code. But relax. WordPress works, right out of the box.

    Fussing with tags and keywords are fine if you are determined to get to the top of the charts in the search engines RIGHT NOW. WordPress automatically tags categories, so be very specific with your category names to match known tags, if this is important. Keywords are found in the content by search engines and rarely in the meta tags any more. So make sure she writes great content that is keyword rich.

    The good part comes in the posting and telling the stories. You’re having fun with the tweaking, but the magic comes with getting the stories and pictures from the stories up on the blog fast.

    Good luck, and stop by Lorelle on WordPress, my totally WordPress and blogging new site on wordpress.com. There is even more information that will help you figure out how to do all of this.

  • Posted October 13, 2005 at 13:41 | Permalink

    Hi Lorelle,
    Thanks for your answer
    The rest is following by email

Post a Comment

Your email is kept private. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.