WordPress Plugin: Highlight Current Category

Amanzimtoti on the WordPress testers’ list suggested a core change that would insert the class “current-cat” into the link for a category, if someone’s browsing the archives under that category. It would allow WordPress users to style their themes so as to highlight the relevant category–a good idea. (Amanzimtoti invited everyone to check it out on his blog.)

I figured there must be way to do it using a plugin, so I came up with the Filosofo Highlight Current Category plugin. It should work with WordPress 1.5 and newer. Just extract one of the files below, upload, and activate.

Note: The features in this plugin were added to WordPress back in version 2.0. You do not need to install this plugin in a recent version of WordPress.

7 Comments

  1. Good stuff – that’s much better than hacking the core files!

    Cheers – Stuart

  2. Thanks for the plugin, it looks good. Is there any way to get the parent category to stay highlighted when you select a child of that category?

  3. I try to figure out a way to add the ‘current-cat’ to the category when a post is read in that category (single post). Any clue how to do that?

    Cheers.
    Martijn

  4. just what i was looking for. will try it asap on my blog. thanks

  5. thank you for this solution! this help me a lot. i was sick to modify my theme all the time:)

  6. Thanks for this great plugin!!

  7. It looks like its what I have been looking for.Im going to give it a try straight away.Thanks

8 Trackbacks

  • [...] Il Filosofo A new plugin that allows for a user to style a category if browsing that category under the archives, that is, gives a new hook “current-cat” that would then allow to give that page a differernt style. category Plugin WordPress // Used for showing and hiding user information in the comment form function ShowUtils() { document.getElementById(“authorinfo”).style.display = “”; document.getElementById(“showinfo”).style.display = “none”; document.getElementById(“hideinfo”).style.display = “”; } function HideUtils() { document.getElementById(“authorinfo”).style.display = “none”; document.getElementById(“showinfo”).style.display = “”; document.getElementById(“hideinfo”).style.display = “none”; } [...]

  • [...] Il Filosofo Ľ WordPress Plugin: Highlight Current Category It would allow WordPress users to style their themes so as to highlight the relevant category. [...]

  • Woody Sabran on February 10, 2007 at 2:56 pm

    [...] Highlight Current Category [...]

  • [...] Filosofo Highlight Current Category Add a class to the category link to highlight the category under which you’re currently browsing the archives. [...]

  • Filosofo Highlight Current Category | SURPI on December 2, 2007 at 4:46 pm

    [...] Plugin Page Author: surpi Time: Sunday, December 2nd, 2007 at 10:46 pm Category: WordPress Plugin Comments: You can leave a response, or trackback from your own site. RSS: You can follow any responses to this entry through the RSS 2.0 feed. Navigation: « FancyTooltips [...]

  • [...] Je suis donc parti √† la recherche d’une solution sur le web et je suis tomb√© sur un plugin. N’√©tant pas un grand fan des plugins √† tout va, j’ai continu√© mes recherches et je [...]

  • | wordpresserrors.com on August 5, 2012 at 7:59 pm

    [...] More: By: mark This entry was posted in wordpress error tutorial and tagged 2005-at-1208-am, 2007-at-1217-pm, [...]

  • | wordpresserrors.com on August 5, 2012 at 7:59 pm

    [...] More: By: Martijn Stegink This entry was posted in fix wordpress errors, wordpress error tutorial and tagged archives, [...]