comments on organizer and venue .

Home Forums Calendar Products Events Calendar PRO comments on organizer and venue .

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1382297
    martin75
    Participant

    so i followed this topic here

    the comments forms show up just fine.
    when i goto a single event , and post a comment its 100% functional
    when i goto a single event ,and click on venue i see the comment form, fill out form and click submit , from this click i get returned to the singel event post , and the comment gets posted to the single events page.

    how can i unlink the comment form belonging to the venue from the single events page? im hoping this is a really simple snippet , as a comment form is a really basic wordpress feature.

    i must add that with all plugins disabled and just leaving the events calendar and pro active , the problem still remains even in 2014,15,16 and 2017 themes.

    many thanks in advance.

    #1383146
    Cliff
    Member

    Hi, Martin. I hope you’re doing well.

    That other thread is from 2013, and its code is outdated so here’s a new version (it turned out to be quite a doozie!):

    https://gist.github.com/cliffordp/50a6ad0b2f23a1824b6c621a3e54b2e6

    #1383169
    martin75
    Participant

    many many thanks Cliffe it works absolutky spot on , i also added the following in functions.php to make the same changes to organizers (just in case anyone is ever interested) events,venue and organizers now have stand alone comments , i cant thank you enough!! sort abstract post out and site can go live!!

    /**
    * The Events Calendar PRO: enable comments on single organizer pages.
    *
    * @link https://theeventscalendar.com/support/forums/topic/comments-on-organizer-and-venue/
    */
    add_filter( ‘tribe_events_register_organizer_type_args’, function ( $args ) {
    $args[‘supports’][] = ‘comments’;

    return $args;
    } );

    /**
    * Force “Allow Comments” to TRUE for all organizers.
    */
    add_filter( ‘comments_open’, function ( $open, $post_id ) {
    if (
    function_exists( ‘tribe_is_organizer’ )
    && tribe_is_organizer( $post_id )
    ) {
    return true;
    } else {
    return $open;
    }
    }, 10, 2 );

    /**
    * Load the Comments Form on the organizer single page. Quite a bit of hackery to
    * accomplish this, but it should work reliably.
    */
    add_action( ‘tribe_events_single_organizer_after_upcoming_events’, function () {
    /**
    * Needed because of the comment form’s global $id and global $post
    * thinking it’s an event, not a venue. Possibly a bug in the Venue single
    * page but maybe not.
    */
    wp_reset_postdata();

    /**
    * Remove TEC’s hijacking of the comments template so it’s no longer
    * /wp-content/plugins/the-events-calendar/src/admin-views/no-comments.php
    * and therefore we get to use the theme’s comments.php file, as expected.
    *
    * comments_template() is not needed to load the comments form because it is
    * already loading after removing TEC’s hijacking of the comments template.
    */
    remove_filter( ‘comments_template’, array( ‘Tribe__Events__Template_Factory’, ‘remove_comments_template’ ) );
    remove_filter( ‘comments_template’, array( ‘Tribe__Events__Templates’, ‘load_ecp_comments_page_template’ ) );
    } );

    • This reply was modified 8 years, 5 months ago by martin75.
    #1383200
    Cliff
    Member

    Excellent. Thanks for sharing! 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘comments on organizer and venue .’ is closed to new replies.