youngevity_marketing

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Modifying Child Theme Files #1324712

    For anyone referencing this question in the future, here is the code I added to my theme’s function.php file to overwrite the “<< All Events” link on the page that shows all recurring instances of a single event, and replace it with a link that simply goes back to the last page visited instead.
    The reason for replacing these links was due to the need of putting the default event page in an iframe, so that I could have the calendar with the filter bar on different pages other than just the default events page that is forced by the plugin. Since the filter bar does not work by shortcode at the time of this post.

    My workaround was to create a completely blank template page in my theme, thus there would be no header, footer, wpadminbar, etc. I set the Events Templates to use this new template then put the full calendar into an iframe on the pages of my choosing.

    Plugins used:

    The Events Calendar
    The Events Calendar PRO
    The Events Calendar Filter Bar
    Iframe Resizer: https://github.com/davidjbradshaw/iframe-resizer

    Code added to function.php:

    remove_action( ‘tribe_events_list_before_the_content’, array( ‘Tribe__Events__Pro__Templates__Mods__List_View’, ‘print_all_events_link’ ) );
    add_action( ‘tribe_events_list_before_the_content’, ‘print_all_events_link’ );

    function print_all_events_link(){
    // Only add this link if we are viewing all instances of a recurring event (ie, ‘/event/some-slug/all/’)
    if ( ‘all’ !== $GLOBALS[‘wp_query’]->get( ‘eventDisplay’ ) ) {
    return;
    }

    if ( tribe_is_recurring_event() ) {
    ?>
    <p class=”tribe-events-back tribe-events-loop”>
    ” rel=”bookmark”><?php printf( __( ‘« Back’, ‘tribe-events-calendar-pro’ ), tribe_get_event_label_plural() ); ?>

    <?php
    }
    }

    The other 2 places I changed this back type of functionality was:

    /views/pro/single-venue.php
    /views/pro/single_organizer.php

Viewing 1 post (of 1 total)