I'm basically using a 'latest comments' system on multiple pages where one specific user is listed as the first reply for a comment - highlighted with special CSS - and then 2-3 normal users below this 'special comment'.
I would like the specific user to be excluded from the list of normal users but I can't figure it out. Sorry if the HTML is a bit of a mess but really it's the second $args array that matters.
<?php $args = array(
'user_id' => $curauth->ID,
'number' => 5,
'status' => 'approve',
'parent' => 0
);
$comments = get_comments($args);
if ( $comments )
{
foreach($comments as $c){
echo '<div id="authorcommentsmain">';
echo '<ul id="authorcomments">';
echo '<li>';
echo '<a id="authorcommentlink" href="'.get_comment_link( $c->comment_ID ).'"> ';
echo get_the_title($c->comment_post_ID);
echo '</a>';
echo "</br>";
echo "<div id='authorcommentslatest'><div id='authorcommentsuserphoto'>";
echo userphoto($c->user_id, '', '', array(id => 'latestcommentsprofile'));
echo "</div>";
echo "<div id='authorcommentexcerpt'> <p>";
echo my_get_comment_excerpt( $c->comment_ID, 80 );
echo "</p></div></div></li>\n";
echo '</ul></div>';
$comment_meta_args2 = array(
'status' => 'approve',
'parent' => intval($parent_comment_id),
'number' => 1,
'user_id' => 1,
'order' => ASC
);
$replies2 = get_comments($comment_meta_args2);
$parent_comment_id = $c->comment_ID;
$comment_meta_args = array(
'status' => 'approve',
'parent' => intval($parent_comment_id),
'number' => 2,
'order' => ASC
);
$replies = get_comments($comment_meta_args);
if ( $replies2)
{
foreach($replies2 as $r2) {
echo '<div id="authorcommentsmainSPECIAL">';
echo '<ul id="authorcommentsSPECIAL">';
echo '<li>';
echo "<div id='authorcommentexcerptSPECIAL'>";
echo "<div id='authorcommentsuserphotoSPECIAL'>";
echo userphoto_thumbnail($r2->user_id, '', '', array(id => 'latestcommentsprofileSPECIAL'));
echo "</div>";
echo "<div id='authorcommentexcerptSPECIALa'>" . get_comment_author ($r2->comment_ID) . " says... </div> <div id='authorcommentexcerptSPECIALb'>" . get_comment_excerpt( $r2->comment_ID );
echo "</div></div></li>\n";
echo '</ul></div>';
}
if ( $replies )
{
foreach($replies as $r) {
echo '<div id="authorcommentsmain2">';
echo '<ul id="authorcomments2">';
echo '<li>';
echo "<div id='authorcommentexcerpt2'>";
echo "<div id='authorcommentsuserphoto2'>";
echo userphoto_thumbnail($r->user_id, '', '', array(id => 'latestcommentsprofile2'));
echo "</div>";
echo "<div id='authorcommentexcerpt2a'>" . get_comment_author ($r->comment_ID) . " says: </div> <div id='authorcommentexcerpt2b'>" . get_comment_excerpt( $r->comment_ID );
echo "</div></div></li>\n";
echo '</ul></div>';
}
}
}
}
} else { echo "<p style='text-align: center'> Nothing! </p>\n";} ?>
$curauth->ID
?get_comments()
function you get a list of comments. So, you can include/exclude comments accroding with some criteria, for example you can exclude comments made by user with ID = 1. But you say that you don't want to exlucde comments made by user with ID = 1, you want to exlude user with ID = 1. I'm sorry but I can not imagine how to do that. Can you think again about what you are trying to do and explain it again?