Currently, I’m using a WordPress theme that is built on Foundation. However, the theme doesn’t have its own comment.php file and it’s currently using the soon to be deprecated comments.php from wordpress\wp-includes\theme-compat folder.
So what I did is to copy/paste the latest comments.php file from the TwentyTwelve theme folder into my current theme folder. However, this results in an error:
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'twentytwelve_comment' not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\comment-template.php on line 1334
…since it’s not properly wired up. What should I do to get the comments.php to work properly?
TwentyTwelve uses a function of its own to format comments–
twentytwelve_comment. In the file you copied–comments.php— you should see this line:That callback is to a function that doesn’t exist in your theme, since it is defined in TwentyTwelve’s
functions.phpand not yours. You can…'callback' => 'twentytwelve_comment',. It is optional. WordPress will use a default formatting function– actually amethodof theWalker_commentclass. Its a bit hard to find. 🙂