The MU forums have moved to WordPress.org

highlighing author comments? (8 posts)

  1. sepp88
    Member
    Posted 14 years ago #

    i know there's a lot of stuff out there explaining my question, but i've no chance to get it actually to work the way i want it. i found this piece of code that let's me set a comment color by a user_id.

    <li class=”<?php
    /* Only use the authcomment class from style.css if the user_id is 1 (admin) */
    if (1 == $comment->user_id)
    $oddcomment = “authcomment”;
    echo $oddcomment;
    ?>” id=”comment…

    however i'm running wpmu and i have multiple users. is there a better way to solve this problem for multiple users. would you add a loop or something to get through all user_id's??? i know there is this il.byuser class, however it's not working for me because my theme doesn't use wp_list_comments to get the comments.

  2. andrea_r
    Moderator
    Posted 14 years ago #

    That code above only works on one blog at a time, not sitewide. And it is only for the one theme on the one blog.

  3. sepp88
    Member
    Posted 14 years ago #

    have you any other idea how to style all user comments sitewide. i just want every user on all blogs to have colored comments. and i don't need different colors for every user, i just need one color for every user-comment sitewide. is that somehow possible?

  4. sepp88
    Member
    Posted 14 years ago #

    no idea? it would be so cool if i could give all my blogusers a yellow color for their comments. please guys help me!

  5. andrea_r
    Moderator
    Posted 14 years ago #

    Well, if each blog has a different theme, then the styling for the comments will be controlled by that theme, and quite likely have differently labelled css classes around them. you'd have to account for each of them.

    Plus, each admin user of each blog will have a different user ID.

  6. sepp88
    Member
    Posted 14 years ago #

    first of all, all blogs have the same theme.

    so i only need to set it up for one theme. the coolest thing would be if it would work completely dynamically without passing in user_id's or email-adresses of the blog users.

    i'm just thinking of three more lines in my css like this:

    .comment_from_user {
    background-color:#00FF00;
    }

    and i think all i'd need to do is change the one and only comments.php file to look out if a comment comes from one of the blogusers and if so, assign the "comment_from_user"-class.

    is that possible? i have no idea how to achieve that.

  7. sepp88
    Member
    Posted 14 years ago #

    maybe i could work with the get_blog_owner plugin for MU.
    http://wpmudevorg.wordpress.com/project/get-blog-owner

    maybe it's possible to retrieve all user's with one single query. if a username is equal to the comment-author another class get assigned???

    would that be an idea?

  8. sepp88
    Member
    Posted 14 years ago #

    SOLVED IT! yeah...http://sw-guide.de/wordpress/wordpress-theme-optimierungen/

About this Topic