<?php global $comment_id, $wpdb; ?>
<div class="comments">
    <h3 class="section-title"><?php _(comments_number('No Comments','1 Comment','% Comments')); ?></h3>
    <ul class="comment-container">
         <?php  foreach ($comments as $comment) :
            if ($comment->comment_parent == 0) :
                $comment_table = $wpdb->prefix . "ocmx_comment_meta";
                $comment_meta_sql = "SELECT * FROM $comment_table WHERE commentId = ".$comment->comment_ID." LIMIT 1";
                $comment_meta = $wpdb->get_row($comment_meta_sql);
                $comment_type = get_comment_type(); ?>
                <li class="comment clearfix">
                    <a href="#" class="comment-avatar"><?php echo get_avatar($comment, 45); ?> </a>
                    <div class="comment-post">
                        <h5 class="date"> <?php comment_date('d M Y'); ?></h5>
                        <h4 class="comment-name"><a href="<?php comment_author_url(); ?>" class="commentor_url" name="comment-<?php echo $comment->comment_ID; ?>" rel="nofollow"><?php comment_author(); ?></a></h4>
                       <?php if ($comment->comment_approved == '0') : ?>
                            <p><?php _e("Comment is awaiting moderation."); ?></p>
                        <?php else :
                            comment_text();
                        endif; ?>
                    </div>
					<?php  fetch_comments($comment->comment_ID); ?>
                </li>
            <?php endif; ?>
        <?php endforeach; ?>
    </ul>
</div>
<div class="leave-comment">
    <h3 class="section-title"><?php _e("Leave a Comment"); ?></h3>
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" class="comment_form">
        <p>
            <input type="text" name="author" maxlength="50" value="" />
            <label>Name</label>
        </p>
        <p>
            <input type="text" name="email" maxlength="200" value="" />
            <label>Email</label>
        </p>
        <p>
            <input type="text" name="url" maxlength="50" value="" />
            <label>Link</label>
        </p>
        <p>
            <input type="text" name="twitter" maxlength="50" value="" />
            <label>Twitter</label>
        </p>
        <p>
            <textarea  name="comment"></textarea>
        </p>
        <input type="submit" class="submit_button" value="Post Comment" name="cmdSubmit" />
        <input type="hidden" id="comment_post_id" name="comment_post_ID" value="<?php echo $id; ?>" />
        <input type="hidden" id="comment_parent_id" name="comment_parent_id" value="0" />                         
    </form>		
</div>