Home › Forums › Calendar Products › Events Calendar PRO › comments on organizer and venue .
- This topic has 4 replies, 3 voices, and was last updated 8 years, 5 months ago by
Cliff.
-
AuthorPosts
-
November 14, 2017 at 4:33 am #1382297
martin75
Participantso 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.
November 14, 2017 at 6:22 pm #1383146Cliff
MemberHi, 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
November 14, 2017 at 7:34 pm #1383169martin75
Participantmany 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’sglobal $idandglobal $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.
November 14, 2017 at 8:14 pm #1383200Cliff
MemberExcellent. Thanks for sharing! 🙂
-
This reply was modified 8 years, 5 months ago by
-
AuthorPosts
- The topic ‘comments on organizer and venue .’ is closed to new replies.
