Home › Forums › Calendar Products › Events Calendar PRO › Adding a button to the category view
- This topic has 6 replies, 4 voices, and was last updated 7 years, 8 months ago by Marlene Hassel.
-
AuthorPosts
-
August 2, 2016 at 3:47 am #1146456Marlene HasselParticipant
I have added a custom button next to the export button in the events list by echoing it in the maybe_add_link() function in the-events-calendar/src/Tribe/iCal.php.
Is there a way to do this in my functions.php instead of modifying the code of the plugin?
August 2, 2016 at 3:49 am #1146459Marlene HasselParticipantThis reply is private.
- This reply was modified 7 years, 9 months ago by Marlene Hassel.
August 2, 2016 at 11:47 am #1146743GeoffMemberHi Marlene,
Great question! Yes, that would be possible. For example, you could write a function that checks for what view is currently being viewed and display content based on that condition:
add_filter('tribe_events_before_html', 'tribe_custom_content'); function tribe_custom_content() { if( tribe_is_photo() && is_tax() ) { echo 'This is a Category in Photo View!'; } }
Will that help you get started? Please let me know. 🙂
Cheers!
GeoffAugust 3, 2016 at 5:01 am #1146970Marlene HasselParticipantYes that works!
So there’s tribe_events_before_html and tribe_events_after_html,
but what about adding something before or after a specific element inside the html? Like the tribe-events-page-title or tribe-events-bar
Are there functions for that as well?August 3, 2016 at 7:20 am #1147012GeoffMemberYou bet! There are a ton of functions just like that.
In fact, every function is documented right here:
https://theeventscalendar.com/plugin/the-events-calendar/A few you may want to consider:
- tribe_events_single_event_before_the_content
- tribe_events_single_event_after_the_content
- tribe_events_single_event_before_the_meta
- tribe_events_single_event_after_the_meta
Cheers!
GeoffAugust 25, 2016 at 9:35 am #1155853Support 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 button to the category view’ is closed to new replies.