WordPress.org

Support

Support » How-To and Troubleshooting » Getting an error where comment box used to be

Getting an error where comment box used to be

  • Hi,

    I’ve switched comments off on posts by unticking in screen options.

    I am now receiving this error where the comment box used to be:

    Warning: call_user_func() expects parameter 1 to be a valid callback, function ‘custom_comment’ not found or invalid function name in /home/website/public_html/wp-includes/comment-template.php on line 1334

    Can someone please help me with this? I have no idea what the problem is!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    what is the code in comments.php, in the line with wp_list_comments() ?

    does the function custom_comment() exist in functions.php of your theme (or anywhere else in your theme) ?

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

    what theme are you using?

    The code in comment.php is
    <?php wp_list_comments('avatar_size=75&callback=custom_comment&type=comment'); ?>

    and

    <?php wp_list_comments('type=pings&callback=list_pings'); ?>

    If I change it to ` <?php wp_list_comments(); ?>’ The error disappears but the comments appear no matter what, even if i have unticked comments in screen options.

    In functions I can’t find it anywhere. The only place I can find custom_comments is in theme-comments.php

    Moderator Michael

    @alchymyth

    Forum Moderator

    this is causing the problem:

    callback=custom_comment

    because it would expect to find a corresponding function in your theme.

    where did you download the theme from?
    did you make any edits to comments.php or functions.php?

    to get rid of the error message, for a start, try to remove the callback from this line; after the changes:

    <?php wp_list_comments('avatar_size=75&type=comment'); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Getting an error where comment box used to be’ is closed to new replies.