WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. kimmi_baby
    Member
    Posted 1 year ago #

    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!

  2. alchymyth
    Forum Moderator
    Posted 1 year 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) ?

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

    what theme are you using?

  3. kimmi_baby
    Member
    Posted 1 year ago #

    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

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags