• I have run into another problem. I use the alternative coloring system but for some reason if I happen to post a comment when it lands on the alt class I get the ‘alt’ class and the ‘admin-comments’ class joined together.

    For example: instead of ‘<li class=”admin-comments” id=”comment-31″>’ I get ‘<li class=”altadmin-comments” id=”comment-31″>’ if you land on the ‘alt’ color comment box.

    I have posted my comment code for a clearer view: http://www.elyonline.co.uk/comments.txt

    Is there an easy way to overide the ‘alt’ class for the ‘admin-comments’ class?

    Many thanks
    Karl

Viewing 3 replies - 1 through 3 (of 3 total)
  • You could simply add a space to the 'alt' string (e.g. 'alt ').

    Check your code for the insertion of class to:


    <li class="<?php echo (is_wpuser_comment() ? 'admin-comments' : '$oddcomment'); ?>" id="comment-<?php comment_ID() ?>">
    </coode>

    You are echo'ing $oddcomment and also echo'ing admin-comments immediately after, you should do one or the other.

    Regards

    Thread Starter karlb

    (@karlb)

    Thanks Coldforged. It might be unsightly but it worked 🙂

    Cypher: How would I do that? To allow ‘alt’ to work for non admin users but to replace with ‘admin-comment’ for admin?

    Thanks Gents
    Karl

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

The topic ‘Need some help with PHP and WP’ is closed to new replies.