Title: Warning: call_user_func(comment_list) [function.call-user-func]: First argument
Last modified: August 20, 2016

---

# Warning: call_user_func(comment_list) [function.call-user-func]: First argument

 *  [Gyrate360](https://wordpress.org/support/users/57842312-1/)
 * (@57842312-1)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/)
 * I did’t find a way to this ,It always say Warning: call_user_func(comment_list)[
   function.call-user-func]: First argument is expected to be a valid callback in
   D:\www\wordpress\wp-includes\comment-template.php on line 1337 in my comment 
   temolate
    Thank you in advance for any help
 * this is my single.php code
 *     ```
       <?php
       	get_header();
       ?>
       	<div id="main" role="homepage">
       		<div class="row clearfix">
       			<aside class="col-4">
       				<?php get_inc_file("mainNav");?>
       			</aside>
       			<div class="col-8 col-last">
       			<?php while ( have_posts() ) : the_post(); ?>
       				<div id="content" class="post-single">
       					<article class="post clearfix">
       						<h2><?php the_title(); ?></h2>
       						<div class="post-tools">
       							<!-- AddThis Button BEGIN -->
       							<div class="addthis_toolbox addthis_default_style ">
       								<a></a>
       								<a></a>
       								<a></a>
       							</div>
       							<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4f8545051e780650"></script>
       							<!-- AddThis Button END -->
       						</div>
       						<div class="post-meta clearfix">
       							<span class="ico post-tags"><i class="ir"></i><?php the_taxonomies(); ?></span>
       						</div>
       						<!-- <div class="post-meta clearfix">
       							<?php the_taxonomies(array('before'=>'<div class="post-meta clearfix"><span class="i_category">','sep'=>'</span><span class="i_tag"></span>','after'=>'</div>')); ?>
       							<span class="ico post-tags"><i class="ir"></i><?php the_tags(__(' '), '、'); ?></span>
       						</div> -->
       						<!-- .post-meta -->
       						<?php
       							$post_images = bdw_get_images($post->ID,'large');
       							print_r($post_images);
       						?>
       						<div class="post-masthead">
       							<img src="http://placehold.it/590x300" width="590" height="300" />
       						</div>
       						<!-- .post-masthead -->
       						<div class="post-event">
       							<div class="row clearfix">
       								<div class="event-date col">
       									<strong>Date</strong>: <?php echo get_formated_date(get_post_meta($post->ID,'st_date',true));?> to <?php echo get_formated_date(get_post_meta($post->ID,'end_date',true));?>
       								</div>
       								<div class="event-time col">
       									<strong>Time</strong>: <?php echo get_formated_time(get_post_meta($post->ID,'st_time',true))?> - <?php echo get_formated_time(get_post_meta($post->ID,'end_time',true))?>
       								</div>
       							</div>
       							<!-- .row -->
       							<div class="row clearfix">
       								<div class="event-venue col">
       									<strong>Venue</strong>: <?php echo get_post_meta($post->ID,'address',true);?>
       								</div>
       							</div>
       							<!-- .row -->
       							<div class="row clearfix">
       								<div class="event-stickers col">
       									<strong>Stickers Worth</strong>: 25
       								</div>
       								<div class="event-fees col">
       									<strong>Admission Fees</strong>: $25 per participant
       								</div>
       							</div>
       							<!-- .row -->
       							<div class="row clearfix">
       								<div class="event-venue col">
       									<strong>Guest of Honour</strong>: Mr Tan Ah Teck
       								</div>
       							</div>
       							<!-- .row -->
       						</div>
       						<!-- .post-event -->
       						<div class="post-content clearfix">
       							<p>
       								<?php if(get_the_content()){the_content();}else{echo nl2br($post->post_content);}?>
       							</p>
       						</div>
       						<!-- post-content -->
       					</article>
       					<?php if(get_option('default_comment_status')){?>
       						<?php comments_template("/comments.php"); ?>
       					<?php }?>
       				</div>
       				<?php endwhile; ?>
       				<!-- #content -->
       			</div>
       			<!-- .col-8 -->
       		</div>
       		<!-- .row -->
   
       	</div>
       	<!-- #main -->
   
       	<?php get_footer(); ?>
   
       </blockquote>
       this is my comments.php codes
   
       <blockquote><?php
       /**
        * The template for displaying Comments.
        *
        * The area of the page that contains both current comments
        * and the comment form. The actual display of comments is
        * handled by a callback to twentyeleven_comment() which is
        * located in the functions.php file.
        *
        * @package WordPress
        * @subpackage dzcas
        * @since dzcas 1.0
        */
       	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
       		die ('Please do not load this page directly. Thanks!');
   
       	if ( post_password_required() ) { ?>
       		<p class="nocomments"><?php echo get_option('ptthemes_password_protected_name'); ?></p>
       	<?php
       		return;
       	}
       ?>
       <div id="comments">
       		<?php my_comment_form();?>
       		<?php if ( post_password_required() ) { ?>
       	    		<p><?php _e( 'This post is password protected. Enter the password to view any comments.' ); ?></p>
       	    		<?php return;?>
           	<?php }?>
           	<?php if ( have_comments() ) { ?>
       	    	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?>
       				<div class="navigation">
       					<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Comments', 'twentyten' ) ); ?></div>
       					<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
       				</div> <!-- .navigation -->
       			<?php } // check for comment navigation ?>
       			<?php
       			 	global $is_place_post; if($is_place_post){ $comment_count_text = REVIEW_TEXT;}else{$comment_count_text = COMMENT_TEXT;}
       			 	if($is_place_post){ $comment_count_text2 = REVIEW_TEXT2;}else{$comment_count_text2 = COMMENT_TEXT2;}
       			?>
       			<h3> <?php comments_number('0 '.$comment_count_text, '1 '.$comment_count_text, '% '.$comment_count_text2);?> </h3>
           		<ol class="clist">
           			<?php wp_list_comments('avatar_size=60&callback=comment_list');?>
   
       	    <?php }else{ ?>
       	    	<?php if ( ! comments_open() ) {?>
       	    		<p class="nocomments"><?php _e( 'Comments are closed.' ); ?></p>
       	    	<?php }else{?>
       	    		<p>No comments yet. You should be kind and add one!</p>
       	    	<?php }?>
       		<?php }?>
   
       </div>
       <!-- #comments-->
       </blockquote>
       this is my function.php
   
       <blockquote><?php function comment_list($comment, $args, $depth){?>
       	<?php $GLOBALS['comment'] = $comment; ?>
       	<li id="comment-<?php comment_ID() ?>" class="comment even">
       		<div class="gravatar"><?php echo get_avatar( $comment, 60, $template_path . ''.get_bloginfo('template_directory').'/images/gravatar.png' ); ?> </div>
       		<div class="block">
       			<div class="comment-text">
       				<?php comment_text() ?>
       				<?php if ($comment->comment_approved == '0') : ?>
       		        	<p><em><?php _e('Your comment is awaiting moderation.'); ?></em></p>
       		        <?php endif; ?>
       			</div>
       			<!--.comment-text-->
       	        <div class="comment-meta">
       	        	<?php  edit_comment_link(''.__('Edit').'', '', ''); ?>
       	        	<?php comment_author_link() ?> <?php if(!function_exists('how_long_ago')){comment_date('M/d/Y'); } else { echo how_long_ago(get_comment_time('U')); } ?>
       	        </div>
                   <!--.comment-meta-->
       		</div>
   
       <?php }?>
       ```
   
 * any code U can ask me!
 * _[Moderator Note: Please post code or markup snippets between backticks or use
   the code button. Or better still – use a [pastebin](http://pastebin.com/). As
   it stands, your posted code may now have been permanently damaged/corrupted by
   the forum’s parser.]_

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213893)
 * what is the code of the comments.php?
 *  Thread Starter [Gyrate360](https://wordpress.org/support/users/57842312-1/)
 * (@57842312-1)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213901)
 * @chymyth
    The Sweeper & Moderator
 *  the comments.php codes
 *     ```
       <?php
       /**
        * The template for displaying Comments.
        *
        * The area of the page that contains both current comments
        * and the comment form. The actual display of comments is
        * handled by a callback to twentyeleven_comment() which is
        * located in the functions.php file.
        *
        * @package WordPress
        * @subpackage dzcas
        * @since dzcas 1.0
        */
       	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
       		die ('Please do not load this page directly. Thanks!');
   
       	if ( post_password_required() ) { ?>
       		<p class="nocomments"><?php echo get_option('ptthemes_password_protected_name'); ?></p>
       	<?php
       		return;
       	}
       ?>
       <div id="comments">
       		<?php my_comment_form();?>
       		<?php if ( post_password_required() ) { ?>
       	    		<p><?php _e( 'This post is password protected. Enter the password to view any comments.' ); ?></p>
       	    		<?php return;?>
           	<?php }?>
           	<?php if ( have_comments() ) { ?>
       	    	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) { // Are there comments to navigate through? ?>
       				<div class="navigation">
       					<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">←</span> Older Comments', 'twentyten' ) ); ?></div>
       					<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
       				</div> <!-- .navigation -->
       			<?php } // check for comment navigation ?>
       			<?php
       			 	global $is_place_post; if($is_place_post){ $comment_count_text = REVIEW_TEXT;}else{$comment_count_text = COMMENT_TEXT;}
       			 	if($is_place_post){ $comment_count_text2 = REVIEW_TEXT2;}else{$comment_count_text2 = COMMENT_TEXT2;}
       			?>
       			<h3> <?php comments_number('0 '.$comment_count_text, '1 '.$comment_count_text, '% '.$comment_count_text2);?> </h3>
           		<ol class="clist">
           			<?php wp_list_comments('avatar_size=60&callback=comment_list');?>
   
       	    <?php }else{ ?>
       	    	<?php if ( ! comments_open() ) {?>
       	    		<p class="nocomments"><?php _e( 'Comments are closed.' ); ?></p>
       	    	<?php }else{?>
       	    		<p>No comments yet. You should be kind and add one!</p>
       	    	<?php }?>
       		<?php }?>
   
       </div>
       <!-- #comments-->
       ```
   
 * _[Moderator Note: Please post code or markup snippets between backticks or use
   the code button. Or better still – use a [pastebin](http://pastebin.com/). As
   it stands, your posted code may now have been permanently damaged/corrupted by
   the forum’s parser.]_
 * thx a lot in advance my gmai is _[email address moderated – this forum does not
   provide support via email] _ U can contact
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213904)
 *     ```
       <?php wp_list_comments('avatar_size=60&callback=comment_list');?>
       ```
   
 * [http://codex.wordpress.org/Function_Reference/wp_list_comments](http://codex.wordpress.org/Function_Reference/wp_list_comments)
 * do you have a function ‘comment_list()’ in your theme? possibly in functions.
   php?
 *  Thread Starter [Gyrate360](https://wordpress.org/support/users/57842312-1/)
 * (@57842312-1)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213942)
 * yes I have
    here it is
 * > <?php function comment_list($comment, $args, $depth){?>
   >  <?php $GLOBALS[‘comment’]
   > = $comment; ?> <li id=”comment-<?php comment_ID() ?>” class=”comment even”>
   > <div class=”gravatar”><?php echo get_avatar( $comment, 60, $template_path .”.
   > get_bloginfo(‘template_directory’).’/images/gravatar.png’ ); ?> </div> <div
   > class=”block”> <div class=”comment-text”> <?php comment_text() ?> <?php if (
   > $comment->comment_approved == ‘0’) : ?> <p>_<?php \_e(‘Your comment is awaiting
   > moderation.’); ?>_</p> <?php endif; ?> </div> <!–.comment-text–> <div class
   > =”comment-meta”> <?php edit_comment_link(”.__(‘Edit’).”, ”, ”); ?> <?php comment_author_link()?
   > > <?php if(!function_exists(‘how_long_ago’)){comment_date(‘M/d/Y’); } else {
   > echo how_long_ago(get_comment_time(‘U’)); } ?> </div> <!–.comment-meta–> </
   > div>
   > <?php }?>
 *  Thread Starter [Gyrate360](https://wordpress.org/support/users/57842312-1/)
 * (@57842312-1)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213943)
 * I delete the code ‘avatar_size=60&callback=comment_list’ out of ‘<?php wp_list_comments(‘
   avatar_size=60&callback=comment_list’);?>’ in comment.php
    that’s to use ‘<?php
   wp_list_comments();?>’,In this way,It can work,but I need a custom loop,and then
   I thougt I may be my function ‘comment_list’ has problem , so I copy the theme
   twentyten’s function ‘twentyten_comment’ but It still outputs the same warning!
   I don’t know what to do next,I got missed!
 *  Thread Starter [Gyrate360](https://wordpress.org/support/users/57842312-1/)
 * (@57842312-1)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213944)
 * oh I had a way
 * because I didn’t put the function “comment_list” in function.php

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

The topic ‘Warning: call_user_func(comment_list) [function.call-user-func]: First
argument’ is closed to new replies.

## Tags

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

 * 6 replies
 * 2 participants
 * Last reply from: [Gyrate360](https://wordpress.org/support/users/57842312-1/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/warning-call_user_funccomment_list-functioncall-user-func-first-argument/#post-3213944)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
