Adding a button to the category view

Home Forums Calendar Products Events Calendar PRO Adding a button to the category view

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1146456
    Marlene Hassel
    Participant

    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?

    #1146459
    Marlene Hassel
    Participant

    This reply is private.

    #1146743
    Geoff
    Member

    Hi 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!
    Geoff

    #1146970
    Marlene Hassel
    Participant

    Yes 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?

    #1147012
    Geoff
    Member

    You 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!
    Geoff

    #1155853
    Support Droid
    Keymaster

    Hey 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Adding a button to the category view’ is closed to new replies.