Issue pulling wordpress comments

I’m creating a simple theme using Twitter’s Bootstrap. I am only using wordpress for the blog portion of my website (http://www.mattaltepeter.com/n3). In my single.php file i use to pull in the comments template. Ultimately I would like to use Jetpack comments, but just trying to use the default wordpress one currently. I have created a test post and added a couple comments to it, but the comments do not show up on the post. I switched my theme to twenty-eleven and they did, so it has to be something with my theme. I think the issue is with my comments.php. I’m not entirely sure what to put in there to make it work. I started working on this awhile ago and cannot remember where I got the code that currently resides in comments.php. I tried to copy and paste the code from the twenty-eleven comments.php, but that didn’t work either. Do I need to write custom code for this or what?

Thanks for the help!
Matt

Related posts

Leave a Reply

1 comment

  1. Try using this. This is what I use to call comments.

    In functions.php:

    function custom_comments($comment, $args, $depth) {
      $GLOBALS['comment'] = $comment;
        $GLOBALS['comment_depth'] = $depth;
          ?>
            <li id="comment-<?php comment_ID() ?>" <?php comment_class() ?>>
                <div class="comment-author vcard"><?php commenter_link() ?></div>
                <div class="comment-meta"><?php printf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'your-theme'),
                            get_comment_date(),
                            get_comment_time(),
                            '#comment-' . get_comment_ID() );
                            edit_comment_link(__('Edit', 'your-theme'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>'); ?></div>
          <?php if ($comment->comment_approved == '0') _e("ttttt<span class='unapproved'>Your comment is awaiting moderation.</span>n", 'your-theme') ?>
                  <div class="comment-content">
                    <?php comment_text() ?>
                </div>
                <?php // echo the comment reply link
                    if($args['type'] == 'all' || get_comment_type() == 'comment') :
                        comment_reply_link(array_merge($args, array(
                            'reply_text' => __('Reply','your-theme'), 
                            'login_text' => __('Log in to reply.','your-theme'),
                            'depth' => $depth,
                            'before' => '<div class="comment-reply-link">', 
                            'after' => '</div>'
                        )));
                    endif;
                ?>
        <?php } // end custom_comments
    

    In your post, within the loop:

    <?php if ( ('open' == $post->comment_status) && ('open' == $post->ping_status) ) : // Comments and trackbacks open ?>
                            <?php printf( __( '<a class="comment-link" href="#respond" title="Post a comment">Post a comment</a> or leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'your-theme' ), get_trackback_url() ) ?>
    <?php elseif ( !('open' == $post->comment_status) && ('open' == $post->ping_status) ) : // Only trackbacks open ?>
                            <?php printf( __( 'Comments are closed, but you can leave a trackback: <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback URL</a>.', 'your-theme' ), get_trackback_url() ) ?>
    <?php elseif ( ('open' == $post->comment_status) && !('open' == $post->ping_status) ) : // Only comments open ?>
                            <?php _e( 'Trackbacks are closed, but you can <a class="comment-link" href="#respond" title="Post a comment">post a comment</a>.', 'your-theme' ) ?>
    <?php elseif ( !('open' == $post->comment_status) && !('open' == $post->ping_status) ) : // Comments and trackbacks closed ?>
                            <?php _e( 'Both comments and trackbacks are currently closed.', 'your-theme' ) ?>
    
    <?php comments_template('', true); ?>