Title: Comments callback error
Last modified: August 20, 2016

---

# Comments callback error

 *  [tjphop](https://wordpress.org/support/users/tjphop/)
 * (@tjphop)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/comments-callback-error/)
 * Hello everyone.
 * I am creating my first WordPress theme. I have added the loop to my index.php
   and the posts are displaying as they should. However, the comments are not. The
   number of comments, the link to post a comment and the comment form display as
   they should, but when you submit a comment I get this error:
 * >  Warning: call_user_func(twentyeleven_comment) [function.call-user-func]: First
   > argument is expected to be a valid callback in /home/berrycon/public_html/sandbox/
   > wp-includes/comment-template.php on line 1334
 * in place of where the comments should show up.
 * The test site is at [http://berryconcept.co.uk/sandbox](http://berryconcept.co.uk/sandbox)
 * The WP code on my index page is as follow:
 *     ```
       <?php global $query_string; // required
       $posts = query_posts($query_string.'&posts_per_page=3'); // shows only three posts ?>
   
       <!--Start the default loop-->
   
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
   
       <!-- The following tests if the current post is in category 3. -->
        <!-- If it is, the div box is given the CSS class "post-cat-three". -->
        <!-- Otherwise, the div box will be given the CSS class "post". -->
        <?php if ( in_category('special') ) { ?>
                  <div class="post_special">
        <?php } else { ?>
   
                <div <?php post_class() ?> id="post-<?php the_ID();?>">
        <?php } ?>
       <div class="det">
       <h1 class="title"><a href="<?php the_permalink()?>"<rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
        <!-- Display the Title as a link to the Post's permalink. -->
       <h2 class="author">by <?php the_author_posts_link() ?></h3>
       	<div class="date">
            <h1 class="day"><?php the_time ('d')?></h1>
          	 <h2 class="month_year"><?php the_time('M / y')?> </h2>
       	</div><!--end date-->
       </div><!--end det-->
   
        <!-- Display the Post's content (before more tag) in a div box. -->
        <div class="entry"> <?php the_content('<span class="moretext">(more)</span>'); ?>
        <!-- Display a comma separated list of the Post's Categories. -->
       <p class="postmetadata">
       Posted in <?php the_category(',') ?>
       <strong>|</strong>
        <?php edit_post_link('Edit','','<strong>|</strong>'); ?>
       </div> <!-- closes entry --> 
   
       <div id="pagecomments">
       <?php comments_template();?>
       </div>
   
       <div class=comments">
       <?php comments_popup_link('There are no comments, please add your thoughts ', 'There is 1 comment, please add your thoughts ', 'There are % comments, please add your thoughts '); ?></p>
       </div>
   
       </div><!--closes post or special-->
   
        <!-- Stop The Loop (but note the "else:" - see next line). -->
        <?php endwhile; else: ?>
   
        <!-- The very first "if" tested to see if there were any Posts to -->
        <!-- display.  This "else" part tells what do if there weren't any. -->
        <p>Sorry, no posts matched your criteria.</p>
        <?php include("/searchform.php");?>
   
        <!-- REALLY stop The Loop. -->
        <?php endif; ?>
   
        <?php wp_reset_query(); // reset the query ?>
       ```
   
 * I’d really appreciate some help. Many thanks, Tom

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/comments-callback-error/#post-2174671)
 * First, do not post code longer than about 10 lines; use [Pastebin](http://pastebin.com)
   instead, and link to the code.
 * Second, we’d need to see your `comments.php` template file in order to solve 
   your problem.
 *  Thread Starter [tjphop](https://wordpress.org/support/users/tjphop/)
 * (@tjphop)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/comments-callback-error/#post-2174700)
 * Apologies,
 * [**code from index.php**](http://pastebin.com/0YhtP6wa)
    [ **comments.php**
 *  Thread Starter [tjphop](https://wordpress.org/support/users/tjphop/)
 * (@tjphop)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/comments-callback-error/#post-2174774)
 * I have solved the problem now. Thanks.
 *  [kai_h](https://wordpress.org/support/users/kai_h/)
 * (@kai_h)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/comments-callback-error/#post-2174985)
 * Hi tjphop
 * What was it in the end that fixed it?
 *  [LiamFos](https://wordpress.org/support/users/liamfos/)
 * (@liamfos)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/comments-callback-error/#post-2175059)
 * **Tjphop**
 * I would like to know how you fixed this please 🙂
 *  [LiamFos](https://wordpress.org/support/users/liamfos/)
 * (@liamfos)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/comments-callback-error/#post-2175060)
 * Same error for
 * comment-template.php on line 1334
 *  [wp-user-487](https://wordpress.org/support/users/wp-user-487/)
 * (@wp-user-487)
 * [14 years ago](https://wordpress.org/support/topic/comments-callback-error/#post-2175066)
 * Hi, I am having the same problem on my WP installation. Is there documentation
   on how to fix it? Many thanks

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Comments callback error’ is closed to new replies.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * 7 replies
 * 5 participants
 * Last reply from: [wp-user-487](https://wordpress.org/support/users/wp-user-487/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/comments-callback-error/#post-2175066)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
