Skip to:

Style Keymaster's posts

  • Ashish Kumar (Ashfame)



    I want to have the ability to highlight posts of certain user levels like Keymasters and Moderators. I can see that no special CSS classes are added to their posts so the only way to accomplish it is by comparing the email ID but I was wondering if there is any easier / efficient way to do so?

Viewing 2 replies - 1 through 2 (of 2 total)

  • _ck_


    This would be fairly straightforward to do via a plugin.

    Sam recently modified a filter for a post class based on my suggestion in 1.0

    All you would have to do is hook the filter and examine the user for the post, then add a class based on role.

    So the framework you need is something like this:

    add_filter( 'post_del_class', 'post_class_by_role',10,2);
    function post_class_by_role($classes, $post_id ) {
    // do stuff here, add class to $classes if necessary
    return $classes;

    This won’t work in 0.9 however, you would need a template modification instead.

    Ashish Kumar (Ashfame)


    Yeah! I think I got it. Thanks _ck_ !

    I will try it and get back if I need more help. :)

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar