WordPress.org

Forums

error when replacing twentyeleven theme comment.php to another theme (5 posts)

  1. yashmistrey
    Member
    Posted 3 years ago #

    i want to customize my theme comment

    i tried to replace comments.php (twentyeleven theme) to my theme's comments.php file

    i got an error

    Warning: call_user_func(twentyeleven_comment) [function.call-user-func]: First argument is expected to be a valid callback in
    E:\------------\wwwroot\wp-includes\comment-template.php on line 1334

    please help

  2. alchymyth
    Forum Moderator
    Posted 3 years ago #

    you also need to copy the comment callback function into functions.php of your theme;

    copy it from functions.php of twenty eleven (line 485 to 572):

    if ( ! function_exists( 'twentyeleven_comment' ) ) :
    /**
     * Template for comments and pingbacks.
     *
    ...
    etc.
    ...
    		esc_html( get_the_author() )
    	);
    }
    endif;
  3. yashmistrey
    Member
    Posted 3 years ago #

    thanks friend !

    you mean to paste these code into function.php

    https://gist.github.com/1113826

  4. alchymyth
    Forum Moderator
    Posted 3 years ago #

    yes - that is the right code.

  5. yashmistrey
    Member
    Posted 3 years ago #

    how can i merge this code into comments.php could it possible ?

    i am not so smart in php so if you can tell me, if possible

    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic