Grow your CSS skills. Land your dream job.

Trying to Highlight Author comments

  • # October 20, 2009 at 7:29 pm

    Using this code in the comments.php

    Code:
  • /* Only use the authcomment class from style.css if the user_id is 1 (admin) */
    if (1 == $comment->user_id)
    $oddcomment = “authcomment”;
    echo $oddcomment;
    ?>”

with CSS

Code:
.authcomment {
background-color: #B3FFCC !important;
}

Can’t get it to work. Any Ideas?

You can find an author comment(Barbara) at the bottom of this post.
http://respectyourpet.com/?p=73

# October 21, 2009 at 4:33 am

You have curly quotes, or "smart quotes" – the kind generated by Microsoft Word – in your code. PHP won’t recognise them so make sure you use a programmers text editor to edit PHP files, and only use " and ‘ for quotation marks.

Code:
  • PS. You can use Notepad++ on the PC and TextWrangler on Mac.

    # October 21, 2009 at 8:07 am

    Yea, I was wondering about those question marks. But I am using Coda. Those lines are generated by PHP right?

    # October 21, 2009 at 8:35 am

    As Dave said, change

    Code:
    “authcomment”

    to

    Code:
    “authcomment”
    # October 21, 2009 at 6:31 pm

    Ok, I got that changed, but I’m still seeing the question marks. Any other ideas?

    # October 21, 2009 at 6:49 pm

    You have 4 funny quotes to fix – one on the line starting <li class=", 2 on the line starting $authcomment = and 1 on the ?>" line.

    I think if you get them all it will solve your problem.

    Cheers
    Dave

    # October 21, 2009 at 7:16 pm

    Thanks a million. :ugeek:

    Viewing 7 posts - 1 through 7 (of 7 total)

    You must be logged in to reply to this topic.

    *May or may not contain any actual "CSS" or "Tricks".