• Resolved sarahjadesigns

    (@sarahjadesigns)


    I’ve noticed that on my single post pages I get the trailing end of an HTML comment (-->) showing up after user comments.

    When I look at the HTML I see that this is because two comments are being nested:

    <--
    <br />
    <b>Warning</b>:  call_user_func() expects parameter 1 to be a valid callback, function 'my_comments_callback' not found or invalid function name in <b>/home/luckysta/public_html/wp/wp-includes/comment-template.php</b> on line <b>1334</b><br />
    </li><!-- #comment-## -->
    -->

    Now I’ve researched nested comments a bit and it seems a bit of trickery can make it work. However, I can’t seem to find where these comment tags are in any PHP file! I’ve done a search in my theme and in WordPress’ core files that seem relevant (I know I shouldn’t edit these, but was hoping I could at least find the tags and figure something out), but I just can’t find it.

    Does anyone know where this string is and/or another method of fixing this problem? If it helps, I’m using a child theme of SimpleX and my site is here: https://lucky-stars.ca/ptp

Viewing 3 replies - 1 through 3 (of 3 total)
  • It should or might be gone after you fix that warning.

    Check comments.php for callback function name used in wp_list_comments().

    It should be simplex_comment, not my_comments_callback. In case of using your own callback, make sure there is that function in your functions.php.

    Thread Starter sarahjadesigns

    (@sarahjadesigns)

    Aha! It was using simplex_comment, but my_comments_callback was still there hidden between comment tags. Removing that comment fixed the problem.

    Thanks so much, I never would’ve figured it out without you!

    Glad to hear it all fixed. This kind of thing happens to all of us sometimes ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Nested HTML comments’ is closed to new replies.