yohogdes

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • yohogdes
    Participant

    For anyone looking for help with this issue, check out Tribe’s documentation article here: https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-date-functions/

    in reply to: Changing the Calendar default title #95939
    yohogdes
    Participant

    Hi Julie,
    This is a great solution if I were only dealing with one category, however I need a different title to appear conditionally based on the current category.

    I attempted to alter the code provided and target the current category name, but was unsuccessful.

    This is what I tried in my functions.php file:
    // Customize Tribe Events Titles
    add_filter(‘tribe_get_events_title’, ‘change_upcoming_events_title’);

    function change_upcoming_events_title($title) {
    //We’ll change the title on upcoming and map views
    if ( is_post_type_archive(‘events-category-classes’) ) {
    if (tribe_is_upcoming() or tribe_is_map() or tribe_is_photo()) return ‘Upcoming Classes’;
    } elseif (is_post_type_archive(‘events-category-event’) ) {
    if (tribe_is_upcoming() or tribe_is_map() or tribe_is_photo()) return ‘Upcoming Events’;
    } else {
    //In all other circumstances, leave the original title in place
    return $title;
    }
    }

    Thanks for your help so far!

Viewing 2 posts - 1 through 2 (of 2 total)