Hi, I want to use a different template to show comments (for a single post), in order to add a button/link near the “reply” link, for each comment.
So I have copied comment-template.php from the wp-includes folder to the “templates” folder of my plugin, in order to edit it without editing the wordpress core files. Then I have added the following lines in my plugin:
(@alxr89)
10 years ago
Hi, I want to use a different template to show comments (for a single post), in order to add a button/link near the “reply” link, for each comment.
So I have copied comment-template.php from the wp-includes folder to the “templates” folder of my plugin, in order to edit it without editing the wordpress core files. Then I have added the following lines in my plugin:
add_filter( 'template_include', array($this, 'pf_comment_template'));
with the following function:
But I get the error:
Fatal error: Cannot redeclare get_comment_author() (previously declared in ….\wp-includes\comment-template.php:22)
How can I solve?
Thanks!