Home › Forums › Calendar Products › Community Events › Adding a Community Add event button/link to the Tribe Events Calendar?
- This topic has 2 replies, 2 voices, and was last updated 5 years, 6 months ago by Andras.
-
AuthorPosts
-
September 27, 2018 at 9:15 am #1632233DaveParticipant
I’ve been trying to find a way to combine the Community add event form with the Tribe Events Calendar. So that when a user visits the calendar anywhere on my site, they will be able to click a button (or a text link) that takes them to the Community Add form.
I would appreciate any help with this.
Thanks
DaveOctober 1, 2018 at 12:19 pm #1634618AndrasKeymasterHi Dave,
I see two ways of doing this:
Either you can add a menu / sub-menu entry that points to ‘http://wcn.spinmodern.co/events/community/add’
or you can create template overrides or our views and include the url there.
The first is definitely easier. The amount of work for the second depends on where exactly you want it to show up.
I just figured a third way. If you copy the following code in your child theme’s functions.php file, then it will add the link at the top and / or bottom of your calendar.
[code language=”php”]// This will add it above the calendar
add_action ( ‘tribe_events_before_template’, ‘add_community_events_link’ );
// This will add it below the calendar
add_action ( ‘tribe_events_after_template’, ‘add_community_events_link’ );function add_community_events_link() {
echo ‘<a href="http://wcn.spinmodern.co/events/community/add/">Submit an event to the calendar</a>’;
}[/code]Hope this helps.
Cheers,
AndrasOctober 1, 2018 at 12:21 pm #1634621AndrasKeymasterIf you want to exclude some views, then you can use this function:
Like
[code language=”php”]
if ( tribe_is_view( ‘list’ ) ) {
// do something here
}
[/code]A.
October 23, 2018 at 9:35 am #1647316Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Adding a Community Add event button/link to the Tribe Events Calendar?’ is closed to new replies.