I am editing the comments.php file for the purpose of my site. I want the comment section to be something like this: only the person who made the first comment and the post author will be able to create the next comments one by one. My code goes something like this now. This doesn't work as in the
$current_user->ID == $challengerName
doesn't work..
$challengerName = '';
global $post, $current_user;
$commentNum = get_comments_number();
if ( $commentNum < 10 ) {
if ( $commentNum == 0 ) {
if ( $post->post_author == $current_user->ID ){
}
else{
comment_form($comment_args);
}
}
if ( $commentNum == 1 ) {
$challengerName = get_comment_author();
if ( $post->post_author == $current_user->ID ) {
comment_form($comment_args);
}
else{
}
}
//This handles until comment number 1
if ( $commentNum > 1) {
if ($commentNum % 2 == 0) {
if ( $post->post_author == $current_user->ID ){
}
elseif ($current_user->ID == $challengerName)
{
comment_form($comment_args);
}
}
else{
if ( $post->post_author == $current_user->ID ){
comment_form($comment_args);
}
else{
}
}
}
}//Check end if number of comments is 10 or less
else
{
echo "Debate Over";
}