[wp-testers] Highlight current category...

Stuart amanzimtoti at gmail.com
Fri Oct 28 09:43:19 GMT 2005


I think the plugin is a good idea for current users of Wordpress, but
it would be good to commit this into the code for future versions. I
tried Ryan's code but got errors so maybe I did something wrong. If
others can come up with a working solution then I will put it into the
Trac system.

Cheers - Stuart.

p.s. changed my Gmail preferences so my name should show up properly
in the from address.


On 10/28/05, David House <dmhouse at gmail.com> wrote:
> On 28/10/05, Austin Matzko <ajmatzko at hotmail.com> wrote:
> > Good idea!  I turned it into a little plugin that I think does the same
> > thing:
> >
> > function wp_current_category_class_attribute ($thelist) {
> >         if (!('' == single_cat_title('', FALSE))) {
> >                 $category = single_cat_title('', FALSE);
> >                 $string = '/(<a href.*)(>.*' . $category . ')/';
> >                 return preg_replace("$string"," $1 class=\"current-cat\" $2",$thelist);
> >         }
> >         else return $thelist;
> > }
> > add_filter('list_cats','wp_current_category_class_attribute');
>
> I think it probably existed better as a core patch: as we already do
> this for pages, it makes sense to do it for cats as well. Amanzimtoti,
> if you submitted the core patch with Ryan's suggestions to Trac, it'd
> almost certainly get included.
>
> Great work!
>
> --
> -David House, dmhouse at gmail.com, http://xmouse.ithium.net
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>


More information about the wp-testers mailing list