WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Gyrate360
    Member
    Posted 1 year ago #

    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. As it stands, your posted code may now have been permanently damaged/corrupted by the forum's parser.]

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    what is the code of the comments.php?

  3. Gyrate360
    Member
    Posted 1 year ago #

    @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. 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

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    <?php wp_list_comments('avatar_size=60&callback=comment_list');?>

    http://codex.wordpress.org/Function_Reference/wp_list_comments

    do you have a function 'comment_list()' in your theme? possibly in functions.php?

  5. Gyrate360
    Member
    Posted 1 year ago #

    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 }?>

  6. Gyrate360
    Member
    Posted 1 year ago #

    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!

  7. Gyrate360
    Member
    Posted 1 year ago #

    oh I had a way

    because I didn't put the function "comment_list" in function.php

Topic Closed

This topic has been closed to new replies.

About this Topic