Detect if comments are allowed.

Roland Member, Translator

Hello,
I'm trying to turn on/off a bloc if comments are allowed or not (that is a different question if plugin is activate or not).

I tried this :
if (function_exists('printCommentForm')) { if (commentsAllowed() == true) { echo '<div class="bloc-comments">'; echo '<h2>Commentaires</h2>'; printCommentForm(); echo '</div>'; } }

And this

if (function_exists('printCommentForm')) { if (comment_form_postcomment() == true) { echo '<div class="bloc-comments">'; echo '<h2>Commentaires</h2>'; printCommentForm(); echo '</div>'; } }

Both make PHP fail. But I'm sure I'm close to solution if I had a correct understanding of the documentation : https://docs.zenphoto.org/1.5.x/function-comment_form_postcomment.html :) Any clue ? Thanks !

Comments

Sign In or Register to comment.