Support » Fixing WordPress » comments_popup_link dynamic css

  • Hello,

    i have this situation where the color of my “Comments” links needs to have different in some posts. I looked in the documentation and there is a parameter in the comments_popup_link which we can assign a CSS Class.

    is it possible instead of a static value e.g ‘Redlink’ to pass a dynamic value such as the category of the post? I know how to retrieve the category, just don’t know how to pass it as a parameter.

Viewing 1 replies (of 1 total)
  • ok found it.
    in the loop:

    $category = get_the_category();
    $csspart = $category[0]->cat_name;

    and then:
    comments_popup_link('No Comments »', '1 Comment »', '% Comments »',$csspart);

Viewing 1 replies (of 1 total)
  • The topic ‘comments_popup_link dynamic css’ is closed to new replies.