treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Wordpress Nested Comments Issue

  • Hi there,

    I have hit a wall trying to figure out the nested comment issue I am having. I am hoping that someone here can give me a little help. I am using the wp thread comment plug-in for my comments and nested replies. Every time I add a reply to a comment it's treating it as a comment and putting it at the bottom of the comments list. I have no idea what is going on and would greatly appreciate anyone who could help. Thanks.

    Here is an example of the issue:
    http://www.fullcreative.com/fullwordpre ... 4#comments


    <?php // Do not delete these lines
    if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');

    if (!empty($post->post_password)) { // if there's a password
    if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
    ?>

    <p>This post is password protected. Enter the password to view comments.</p>

    <?php
    return;
    }
    }

    /* This variable is for alternating comment background */
    $oddcomment = 'class=\"alt\" ';
    ?>

    <div class=\"comments\">
    <?php if ($comments) : ?>
    <h3 class=\"comments\"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3><!-- comments -->
    <div class=\"singleComment\">
    <ol class=\"commentlist\">
    <?php wp_list_comments('avatar_size=50'); ?>
    </ol><!-- commentlist -->

    <?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post->comment_status) : ?><!-- If comments are open, but there are no comments. -->

    <?php else : // comments are closed ?>
    <p>Comments are closed.</p>

    <?php endif; ?>
    <?php endif; ?>

    <?php if ('open' == $post->comment_status) : ?>
    <div id=\"respond\">
    <h3><?php comment_form_title( 'Leave a Comment', 'Leave a Reply to %s' ); ?></h3>
    <div class=\"cancel-comment-reply\">
    <small><?php cancel_comment_reply_link(); ?></small>
    </div>

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>You must be <a href=\"<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>\">logged in</a> to post a comment.</p>

    <?php else : ?>
    <form action=\"<?php echo get_option('siteurl'); ?>/wp-comments-post.php\" method=\"post\" id=\"commentform\">

    <?php if ( $user_ID ) : ?>
    <p>Logged in as <a href=\"<?php echo get_option('siteurl'); ?>/wp-admin/profile.php\"><?php echo $user_identity; ?></a>. <a href=\"<?php echo wp_logout_url(get_permalink()); ?>\" title=\"Log out of this account\">Log out &raquo;</a></p>

    <?php else : ?>


    <input type=\"text\" name=\"author\" id=\"author\" value=\"<?php echo $comment_author; ?>Your Name\" size=\"22\" tabindex=\"1\" <?php if ($req) echo \"aria-required='true'\"; ?> />
    <label for=\"author\"></label>

    <input type=\"text\" name=\"email\" id=\"email\" value=\"<?php echo $comment_author_email; ?> Your Email\" size=\"22\" tabindex=\"2\" <?php if ($req) echo \"aria-required='true'\"; ?> />
    <label for=\"email\"</label>

    <input type=\"text\" name=\"url\" id=\"url\" value=\"<?php echo $comment_author_url; ?>Your Website\" size=\"22\" tabindex=\"3\" />
    <label for=\"url\"></label>

    <?php endif; ?>

    <textarea name=\"comment\" id=\"comment\" cols=\"100%\" rows=\"10\" tabindex=\"4\"></textarea>

    <input name=\"submit\" type=\"submit\" id=\"submit\" tabindex=\"5\" value=\"Submit Comment\" />
    <span>* Name and Email Required.</span>
    <input type=\"hidden\" name=\"comment_post_ID\" value=\"<?php echo $id; ?>\" />
    <?php do_action('comment_form', $post->ID); ?>

    <?php comment_id_fields(); ?>
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    </form>



    <?php endif; // If registration required and not logged in ?>
    <?php endif; ?>

    </div><!-- singleComment -->
    </div><!-- comments -->
  • Nevermind, I found it. Thanks.