Jump to content

[SOLVED] Could someone help me with this simple IF/ELSE argument


onewake

Recommended Posts

I've got the following code that I'm trying to make into an IF/ELSE argument...can anybody help me out with it?

 

I've tried several things and can't seem to make it work.

 

<li class="<?php if (1 == $comment->user_id) $oddcomment = "authcomment"; echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
<li class="<?php if (1 != $comment->user_id) $oddcomment = "othrcomment"; echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">

 

I'm basically trying to make it say, "IF the userID=1, $oddcomment = "authcomment" ELSE $oddcomment = "othrcomment"

 

 

<li class="<?php ((1 == $comment->user_id) ? echo 'authcomment' : 'othrcomment'); ?>" id="comment-<?php comment_ID() ?>">
<li class="<?php ((1 != $comment->user_id) ? echo 'authcomment' : 'othrcomment'); ?>" id="comment-<?php comment_ID() ?>">

 

EDIT: Barand got their first..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.