fbpx

How can we help?

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:

<?php
add_filter( 'event_manager_allowed_comment', 'YOUR_THEME_allowed_comment', 10 );
function YOUR_THEME_allowed_comment($status)
{
	$status = 'open';
	return $status;
}
?>

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

For all the previous/ old events, in order to add the comment, also add the following code in the functions.php file:

<?php
function YOUR_THEME_event_allowed_comment( $open, $post_id ) 
{
    $post_type = get_post_type( $post_id );

    if ( $post_type == 'event_listing' ) {
        $open = true;
    }

    return $open;
}
add_filter( 'comments_open', 'YOUR_THEME_event_allowed_comment', 10 , 2 );
?>
Was this article helpful?
How can we improve this article?
Quick Links