How to allow comment forms on each event?

How to allow comment forms on each event?

In order to enable a comment form on the single event page, please add the following code in the functions.php file:

  1. add_filter( 'event_manager_allowed_comment', 'YOUR_THEME_allowed_comment', 10 );
  2. function YOUR_THEME_allowed_comment($status)
  3. {
  4.     $status = 'open';
  5.     return $status;
  6. }

This will be applicable to all the new events that are posted on the website.

To add the comment form to all the previously added events, you need to add the following code to the functions.php file.

  1. function YOUR_THEME_event_allowed_comment( $open, $post_id )
  2. {
  3.     $post_type = get_post_type( $post_id );
  4.     if ( $post_type == 'event_listing' ) {
  5.         $open = true;
  6.     } 
  7.     return $open;
  8. }
  9. add_filter( 'comments_open', 'YOUR_THEME_event_allowed_comment', 10 , 2 );

    • Related Articles

    • Create or pick categories from Free/ Core WP Event manager

      Events are classified into various types based on the kind of visitors they have. Visitors come from different backgrounds. That is why an event organizer or admin must ensure that they make a lot of event categories available to their clients. This ...
    • Editing Event Submission Form Fields

      There are mainly 2 ways to customize the form fields in WP Event Manager : Using the Field editor option from the admin panel. Using the WordPress hooks (filters) which are explained below. Using the field editor option from the admin panel To add, ...
    • Updating WP Event Manager

      Automatic Update WP Event Manager always strives to achieve perfection in every way and that is why we constantly update our plugins so that you can enjoy their innovative features. Here are the steps that you need to take to update WP Event Manager: ...
    • Installation of WP Event Manager

      Automatic Installation of FREE WP Event Manager Installing WP Event Manager is just a matter of a few clicks. You can add WP Event Manager to your website by using the dashboard offered to you at the backend of the CMS. To install the plugin ...
    • Creating a custom event search form

      WP Event Manager’s [Events] shortcode is coded to pick up search_location and search_keywords variables from the query string. Because of this, it’s easy to create a search form elsewhere on your site which posts to your events page. How to Create a ...