Additional menu

Get MemberPress today! Start getting paid for the content you create! Get MemberPress Now
  1. Home
  2. Knowledge Base
  3. Courses
  4. Setting Up Courses
  5. Allow Comments On MemberPress Courses

Allow Comments On MemberPress Courses

MemberPress Courses will have comments disabled on all courses and lessons by default.

This document will show you how to allow comments on individual courses and lessons and for all of your lessons in bulk.

Enabling Comments on Individual Lessons

Comments are not displayed in courses and lessons by default but you can display them following these steps:

  1. Go to MemberPress > Settings page, click the Courses tab, check the “Show Comments Settings on Course and Lesson Pages” option and save it
  2. Once it's done each course and lesson will have a Discussion section with an “Allow comments” option
  3. To display comments on a specific course or lesson you will need to check the “Allow comments” checkbox and save the course/lesson. Here is the screenshot of what the comment form looks like:

Enabling Comments on All Lessons

To display comments on all lessons without the need to check the “Allow Comments” option manually for each lesson you could put the following code snippet to the WPCode plugin (please check this article for details: How to add custom code snippets in WPCode), or if you're using a child theme, then the functions.php file should work as well.

add_filter('comments_open', function($open, $post_id) {
  $post = get_post( $post_id );

  if('mpcs-lesson' == $post->post_type)
   $open = true;

  return $open;
}, 10, 2);
Was this article helpful?

Related Articles

computer girl

Get MemberPress today!

Start getting paid for the content you create.