Comments Plus - Trying to call comments twice & it doesn't work

I am trying to call the comments twice in a page and it isn't working when I have comments plus installed. This is the code I am getting.

Fatal error: Cannot redeclare wdcp_comments_callback() (previously declared in public_html/ptcpeople.com/wp-content/plugins/comments-plus/lib/forms/wdcp-custom_comments_template.php:13) in /home/midsouth/public_html/ptcpeople.com/wp-content/plugins/comments-plus/lib/forms/wdcp-custom_comments_template.php on line 56

  • Vladislav

    Hello,

    Going by the error message, I am assuming you're using the "Custom Comments Template" add-on, which is where the function is defined. Having the comments included twice and having this add-on turned on at the moment won't work - and would actually probably not be what you're after anyway. The add-on will force-load our own template (or your own, custom one, if it can find a properly named template in your theme's directory, as indicated in the add-on description) - but, this inclusion will forcefully happen every time when any comments template is loaded.

    Double-loading the comments template discussion aside, you can absolutely have a custom comments template with Comments Plus. The plugin itself will try its best out of the box to deal with whatever comments template your theme comes with. This is, unfortunately, not always possible, hence the "Custom Comments Template" add-on, which makes the comments environment sane again for the plugin to work with.

    However, even with "Custom Comments Template" add-on active, you can still have the template customized - you just need to copy the "/lib/forms/wdcp-custom_comments_template.php" file from the plugin's directory into your theme's root directory and customize it there. The add-on will first try to load the template from your theme directory and only default to one the plugin ships with if it can't find it. This is also safe for future plugin upgrades, and if you're working with a child theme (as you should, if you're customizing a ready-made theme) or developing a theme yourself, you should be safe for future upgrades of your theme too.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.