Getting an error where comment box used to be (4 posts)

  1. kimmi_baby
    Posted 3 years ago #


    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!

  2. Michael
    Forum Moderator
    Posted 3 years ago #

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


    what theme are you using?

  3. kimmi_baby
    Posted 3 years ago #

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


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

  4. Michael
    Forum Moderator
    Posted 3 years ago #

    this is causing the problem:


    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'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic