WordPress Plugin: Highlight Current Category

by filosofo. Posted on October 27, 2005 at 11:21 pm

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.

5 Trackbacks/Pingbacks

  1. [...] 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”; } [...]

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

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

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

  5. [...] 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 [...]

6 Comments

  1. stuart commented on October 28, 2005 at 12:08 am | Permalink
    stuart

    Good stuff - that’s much better than hacking the core files!

    Cheers - Stuart

  2. jim commented on November 20, 2006 at 9:38 pm | Permalink
    jim

    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. Martijn Stegink commented on February 2, 2007 at 6:14 pm | Permalink
    Martijn Stegink

    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. Prashant commented on August 10, 2007 at 1:49 am | Permalink
    Prashant

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

  5. manele commented on December 1, 2007 at 3:55 am | Permalink
    manele

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

  6. houserocker commented on December 16, 2007 at 12:17 pm | Permalink
    houserocker

    Thanks for this great plugin!!

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*

Subscribe without commenting.