• 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 https://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)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Comments callback error’ is closed to new replies.