So I've just spent hours trying to figure out why my call to comment_form() inside a theme was not rendering at all.

This was a custom post type that supports comments yet nothing rendered.

I eventually debugged and the value for comments_open() for all the posts of this type returned false. I did not find anywhere the discussion 'Panel' inside the Gutenberg editor when editing these post types.

I then inserted this code to force comments_open() to true and now the bloody comment form displays:

  function my_comments_open( $open, $post_id ) {
      return true;

Why on Earth is comments_open() returning false for a CPT that was created two days ago? Absolutely confused.

Thanks in advance!

WordPress version: Version 5.2.2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.