WordPress Plugin: Author Categories (v1.0)

Numerous people are using WordPress for blogging and in many cases there are more than one authors on a website. It’s uncomfortably surprising that WordPress doesn’t support out of the box a category menu for each author separately.

I was looking for this feature online for my personal need but couldn’t find it on any plugin. To be exact I was using a modified version of another similar plugin but that was until version 2.3 where the database structure changed for WordPress and it simply stopped working.

As I saw it, it wasn’t worth fixing old, deprecated (and highly cluttered) code, and there weren’t any other solutions out there, so I decided to create a new plugin. Thankfully the new database and API made it as easy as I had hoped for.

I ended up with this plugin, that was created as a wrapper of the default category menu.

It is lightweight and can easily plug-in, plug-out. Furthermore, being an extension of the default category menu, means that none of the functionality (sorting, post count etc.) is lost. In fact it can be easily extended and could support future versions of the blogging platform for years to come.

Download the Script

Version: 1.0
Language: PHP
File size: 4,87kb

Last 5 projects by Makis

7 Responses to “WordPress Plugin: Author Categories (v1.0)”

  1. Bb Says:

    Thanks for this plugin. I found that the post counts were coming up incorrectly, though. I made a change in the code to compare $category to term_id instead of term_taxonomy_id:


    $sql = "SELECT COUNT(*) FROM $wpdb->term_relationships AS t INNER JOIN $wpdb->posts AS tt INNER JOIN $wpdb->term_taxonomy AS ttt ON t.object_id=tt.ID WHERE t.term_taxonomy_id=ttt.term_taxonomy_id AND ttt.term_id=$category AND tt.post_author=$author AND tt.post_type='post'";

  2. makis Says:

    Hmm, really interesting.

    Can we get some verification on this?

    The query seems to have become quite complicated with the addition of the third column but if you’re right I will include it in a future release.

    Thanks 10x ;)

  3. Ray Says:

    Is there an example of this plugin in use?

    I’m having a hard time understanding what this does.

  4. makis Says:

    Ray, this is a menu enhancement for wordpress.

    When you have more than one authors and you are viewing an authors page you get the menu populated only with items of that author.

  5. sarah Says:

    Hey — I seem to have a problem here : This code doesn’t really seem to do anything differently than the regular, standard categories list. I am looking for a plugin for the sidebar that will only show up on post pages that has links to more posts by the author. Thoughts?

  6. makis Says:

    Hi Sarah,

    You are seeing the default categories because the custom functions are only triggered when the “author” variable is set in the wordpress “loop”. In that case you get a custom menu only with the categories the author has posted in.

    I believe you are looking for a different plugin that presents posts – I have a similar installed on this page called “Posts by author”
    http://www.dagondesign.com/articles/posts-by-author-plugin-for-wordpress/

  7. kevin Says:

    Thank you for this! it almost does exactly what i need, i was wondering if theres a way to exclude categories that an author has not posted in.?

Leave a Reply