• Hi,

    I’d like to style WP2.7 threaded comments. So far I have been able to set odd and even colors, but how can I customize them more?

    I’ve tried Jeremy’s callback function but it didn’t work.

    Anyone has any idea how to do the trick?

    Thanks

Viewing 14 replies - 31 through 44 (of 44 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Again, I don’t know why you think that that code can add only one class.

    function comment_add_whatever($classes) {
    	$classes[] = 'top';
    	$classes[] = 'bottom';
    	$classes[] = 'left';
    	$classes[] = 'right';
    	$classes[] = 'sideways';
    	return $classes;
    }
    add_filter('comment_class','comment_add_whatever');

    Also, your top and bottom thinking *won’t work*. Just by them having two classes doesn’t make it two different things. What’s more, you don’t NEED to add any classes to reference them in CSS. This is plainly obvious if you understood CSS at all. A simple .commentlist li references all the comments. Adding useless “top” and “bottom” classes to them doesn’t help you in any way. Those CSS names are *arbitrary*. They have no inherent meaning.

    I highly suggest you learn a bit more PHP, HTML, and CSS before attempting this. It just seems a lot like you’re in over your head here. You’ve made several basic and fundamental errors in this thread, and I just don’t think you understand enough about web design to do this sort of thing.

    Thread Starter baal666

    (@baal666)

    That’s exactly BECAUSE I am not a pro that I don’t think 2.7 is a great achievement so far. Whatever you think of my CSS and PHP skills, I used to be able to hack my way to do what I wanted to do with 2.6, and it is far more difficult with 2.7

    Thanks anyway.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    I used to be able to hack my way to do what I wanted to do with 2.6, and it is far more difficult with 2.7

    Yes, I suspect that is true. However, 2.7 is not designed for the “unknowledgable hacker”, it’s designed for developers. I mean, what if somebody made a plugin that made customizing your comments really simple? Wouldn’t you prefer that? 2.7 makes designing such a plugin much, much simpler.

    The general WordPress goal is more along the lines that customization should not involve writing code. In the long term, that is the end-goal. WP 2.7 is a step towards that direction by standardizing the comments system.

    Regarding the original topic for this thread… here are some additional WordPress 2.7 Comment Style Starters you can use… Hope it helps!

    Thread Starter baal666

    (@baal666)

    Very interesting cdharrison. Thank you very much.

    By the way, how would you integrate a background image behind the avatar? I’ve tried, but failed every time.

    I was able to get the image but it would not go far enough to the left or the avatar was at the correct place but without the image behind it.

    Thread Starter baal666

    (@baal666)

    Question here: I installed this and it works fine… but for one thing: when I click “Reply” instead of making place for the form right below the comment where I clicked, it links to the bottom of the page. Is there any way to make it work correctly?

    Thanks

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Did you add the wp_enqueue_script code to your theme’s header.php file? I mention that on my post here:

    https://ottodestruct.com/blog/2008/09/29/wordpress-27-comments-enhancements/

    That script call is what makes the reply links work properly.

    Thread Starter baal666

    (@baal666)

    It works perfectly now Otto. Thanks a lot!

    Everyone should go take a look at your page.

    Thread Starter baal666

    (@baal666)

    I now use Otto’s script for displaying reply below comments and Chris Harrison’s CSS and it works well. However, I have trouble setting a different background color for bypostauthor for replies.

    I set ol.commentlist li.bypostauthor {background:#333333 ;}

    and I correctly see a different color when I write a comment in the main place. However, it does not do anything when I reply.

    So I tried this:

    ol.commentlist li ul.children li.bypostauthor {background:#333333 ;}

    but it did not work either. Anyone has any idea?

    Thanks

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Change it to just “.bypostauthor” instead.

    Thread Starter baal666

    (@baal666)

    The problem seems to be more important than this… In fact, I can’t see a different color when I post for a very simple reason: my new 2.7 WP installation does not recognize me…

    Well, I can log in, and do whatever I do, but when I go back to the comments file, I have to re-enter my informations and even if I manually write them correctly, wordpress treats me as if I was a complete stranger.

    I guess this is where the problem started.

    If you have time, I describe the problem here:

    https://www.ads-software.com/support/topic/224549?replies=5

    Thanks.

    BTW, I like WP 2.7 more and more. It’s a difficult nut to crack, but thanks to people like you and Chris, it seems easier now.

    this is to otto really. do you know how to make children avatars smaller than parent comments? I outline what i was after here, if you can help:

    https://www.ads-software.com/support/topic/308302?replies=1

    kyala

    (@kyala)

    Chris,

    Thanks so much for that sample CSS. Saved me hours of swearing and tweaking around with an old theme that didn’t support threading.

    nadish

    (@nadish)

    Hey Guyz!!!

    Can anyone tell me how to stylize comments display like seomoz.com???

    Thanx

Viewing 14 replies - 31 through 44 (of 44 total)
  • The topic ‘How to style WP 2.7 threaded comments’ is closed to new replies.