• Skip to primary navigation
  • Skip to footer navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

WP Fangirl

WordPress Consultant Sallie Goetsch

  • speakerdeck icon
  • Home
  • About
  • Why WordPress?
  • How I Work
  • Portfolio
  • Services
  • Blog
  • Contact

Update: Moving the Events Calendar iCal and Gcal links in 2018 Because code never stands still

April 17, 2018 by Sallie Goetsch Leave a Comment

This entry is part 13 of 13 in the series Modern Tribe Tutorials
calendar export links displayed below event meta and above related events

I’ve been working a lot on the Radiant Body Yoga site lately (more tutorials to come soon), and while preparing some documentation on creating events for the site, I noticed that some of my earlier code had stopped working.

Back in 2016, Kia asked me to move the iCal and Gcal links below the event details (known in TEC as “event meta”), and I wrote a tutorial about how to do that once I figured it out.

It’s now 2018 and Modern Tribe has made substantial changes in The Events Calendar and Events Calendar Pro plugins. My old code was still adding the links below the event meta, but it wasn’t removing the links above the event meta. I wondered whether it might be a matter of the priority I’d used, but I couldn’t see any mention of a priority in the iCal function, and the name of the actual hook had not changed.

A bit of additional Google Fu led me (eventually) to this Gist, referred to in the Events Calendar support forum. The code there creates a class that prevents the calendar export links from showing anywhere on the front end of the site. I didn’t need to remove them entirely, just to reposition the ones on the single event page, so I adapted the code as follows and created my own Gist.

//* Relocate ical and gcal links below meta on single events

class Tribe__Events__Remove__Export__Links {
    public function __construct() {
        add_action( 'init', array( $this, 'single_event_links' ) );
    }
    public function single_event_links() {
        remove_action(
            'tribe_events_single_event_after_the_content',
            array( $this->ical_provider(), 'single_event_links' )
        );
        add_action(
        	'tribe_events_single_event_after_the_meta',
        	array( $this->ical_provider(), 'single_event_links' ), 5
        );
    }
    protected function ical_provider() {
        return function_exists( 'tribe' )
            ? tribe( 'tec.iCal' ) // Current
            : 'Tribe__Events__iCal'; // Legacy
    }
}
new Tribe__Events__Remove__Export__Links();

 

Modern Tribe Tutorials Series Navigation<< Previous Post

Related Items

  • Google Calendar and iCal links displayed below event meta and above related events in The Events Calendar
    Moving the Gcal and iCal Links in The Events Calendar
  • screenshot: final output of [tribe-events-list] shortcode on Livresque du Noir
    Horizontal Output for Events Calendar Pro Shortcode
  • detail of Events Calendar Pro widget on Dit Gentofte website
    Displaying Multiple Rows of Events in Events Calendar Pro Widget

Share this post:

Share on Twitter Share on Facebook Share on Pinterest Share on LinkedIn Share on Email

Filed Under: Using WordPress Tagged With: Tutorial, Events Calendar Pro

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

What I Write About

  • Book Reviews
  • Content Strategy
  • Design
  • Hosting and Servers
  • Most Valuable Plugins
  • There's a Plugin for That
  • Using WordPress
  • Widgets
  • WordPress Consulting
  • WordPress Events

Series

  • Interviews (5)
  • Checking Up on Your Website (4)
  • Client from Hell (5)
  • WordCamps (17)
  • WP-Tonic Roundtable (30)
  • Modern Tribe Tutorials (13)


More in this series:

  • Creating a Horizontal List Widget with Featured Images in Events Calendar Pro
  • Change Photo View in Events Calendar Pro to Equal-Height Grid with Venue & Location
  • Horizontal Output for Events Calendar Pro Shortcode
  • Displaying Multiple Rows of Events in Events Calendar Pro Widget
  • Defining Event Image Size in The Events Calendar by Modern Tribe
  • Removing the List Date from Events Calendar Pro List Widget
  • Adding Non-Standard Pricing Info in The Events Calendar Using ACF
  • Moving the Gcal and iCal Links in The Events Calendar
  • Horizontal Events Widget for Events Calendar Pro — Now with Flexbox!
  • CSS Grid Layout for Event List Widget with Flexbox Fallback
  • How to Change Event Image Size in The Events Calendar without Modifying Templates
  • CSS Grid Layout for Events Calendar Pro Widget Shortcode
  • Update: Moving the Events Calendar iCal and Gcal links in 2018

Follow Sallie on Twitter

    Sorry, no Tweets were found.

RSS Latest News from the East Bay WordPress Meetup

  • Does It Work? Using The New CSS Layout with Rachel Andrew
    Things change rapidly in the WordPress world. The content in this post is more than a year old and may no longer represent best practices.Description Over the past two years, […] The post Does It Work? Using The New CSS Layout with Rachel Andrew appeared first on East Bay WordPress Meetup.
  • Speaker Training
    Get the workbook and slides for the October 2019 speaker training, plus background and pro tips. The post Speaker Training appeared first on East Bay WordPress Meetup.
  • SEO Audit Template & Resources
    Our November speaker, John Locke, graciously provided a template for an SEO audit report. You can download it as a Microsoft Word or PDF document. The post SEO Audit Template & Resources appeared first on East Bay WordPress Meetup.

Footer

Contact Info

2063 Main St #133 · Oakley, CA 94561

+1 (510) 969-9947

author-izer

sallie [at] wpfangirl [dot] com

Location

Map of East Contra Costa County

I live in Oakley, CA and run a WordPress Meetup in Oakland, CA. Don't confuse them!

Subscribe for New Posts

  • Since I blog on an unpredictable schedule, you might want to subscribe by email. I'll also send out occasional announcements about events.

  • Privacy Policy: I will never sell or rent your contact information.

  • This field is for validation purposes and should be left unchanged.
  • Contact
  • Colophon
  • Comment Policy
  • Privacy Policy
  • Five for the Future

Copyright © 2023 · Utility Pro on Genesis Framework · WordPress · Log in

MENU
  • Home
  • About
  • Why WordPress?
  • How I Work
  • Portfolio
  • Services
  • Blog
  • Contact