Facebook Event Times and Link Back To Event

Home Forums Calendar Products Event Aggregator Facebook Event Times and Link Back To Event

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #139965
    amplifiedsteve
    Participant

    I am working on a local site (MAMP) to test out the plugin – everything seems to be working fine except for the following points:

    1. The actual event times are different to that on Facebook
    2. Is there a way to include a link in the post back to the original Facebook event?
    3. When using the Default Events Template how to show the single event content with side bar – ideally using the standard Post Template?

    Thanks

    #140461
    Barry
    Member

    Hi Steve,

    Let me try to answer those questions in turn. Please note that if you need to follow up on more than one of them it would be best to post your question in a separate thread, as we do try to stick to one-issue-per-thread – thanks ๐Ÿ™‚

    1. The actual event times are different to that on Facebook

    Is it possible the source events on Facebook are of a different timezone than is set for your WordPress installation? Does the difference make sense given the gap between your (WP site’s) timezone and the timezone for the event?

    2. Is there a way to include a link in the post back to the original Facebook event?

    Yes – you could add some code like this (to your theme’s functions.php file, or some other suitable location) which would add a link back to the actual Facebook event page:

    // Try to add a link to the FB event pages right before the content
    add_action( 'tribe_events_single_event_before_the_content', 'link_to_fb_event' );
    
    function link_to_fb_event() {
    	// Check if the event is associated with a Facebook event
    	$fbid = tribe_get_event_meta( get_the_ID(), '_FacebookID' );
    	if ( empty( $fbid ) ) return;
    
    	// Form and display a link to the FB event page if so
    	$fburl = esc_url( "http://facebook.com/events/$fbid/" );
    	echo '<a href="' . $fburl . '">See this event on Facebook</a>';
    }

    3. When using the Default Events Template how to show the single event content with side bar โ€“ ideally using the standard Post Template?

    Reading through the Themer’s Guide is a great way to build a sense for how things like this work. There are a few ways you might tackle this – a simple one though would be to detect if the current request relates to a single event and pull in a different template if so.

    I hope that helps ๐Ÿ™‚

    #149829
    amplifiedsteve
    Participant

    Hi Barry,
    Sorry about the delay response, have been away on a short break ๐Ÿ™‚
    Understood about keeping the questions to a single thread – cheers.
    OK, here’s where I’m at:
    1. That seems to have done the trick, thanks.
    2. This suggestion didn’t work for me. I created a functions.php file and placed the above code in my child theme directory but all that happened was showing in my site on the front end (above the header) and didn’t seem to do much else. An option to include a link back to the source FB event would be a great feature from within the admin panel.
    3. I’ll take a look at that in more detail.
    Thanks
    Steve

    #150303
    Barry
    Member

    This suggestion didnโ€™t work for me. I created a functions.php file and placed the above code in my child theme directory but all that happened was showing in my site on the front end (above the header) and didnโ€™t seem to do much else.

    I’m not completely clear on what you are describing, here. Can you clarify/provide a screenshot?

    If you mean the code was literally displaying verbatim on your site and this was a brand new functions.php file that you created can you confirm if there was an opening PHP tag at the top of the file?

    <?php

    #150333
    amplifiedsteve
    Participant

    Hey Barry,

    You we’re right in deciphering my message ๐Ÿ™‚
    I added the opening <?php to my child theme functions.php file and the link back to original facebook post is now pulling through. Very cool.
    I would like to move the link back to the end of the post, and add the _target=”_blank” the link. I guess I can do that by reading though the Themer’s Guide. Bear in ming im not an expert in php but I can find my way around.
    Cheers

    #150335
    amplifiedsteve
    Participant

    ps. i’ve marked this as resolved. thanks

    #151569
    Barry
    Member

    No problem – I’ll go ahead and close the thread (and thanks for indicating it was resolved ๐Ÿ™‚ ). Before I do, though – in case it helps:

    I would like to move the link back to the end of the post, and add the _target=โ€_blankโ€ the link. I guess I can do that by reading though the Themerโ€™s Guide.

    The Themer’s Guide is definitely a great starting point – but once you’ve looked through it you might also be interested in reading through the single-event.php template itself. Notice that in my snippet I’m using the tribe_events_single_event_before_the_content action – you’ll see some other actions in the template itself including tribe_events_single_event_after_the_content which might help you out here (and you could just update the snippet appropriately, replacing one with the other).

    Last but not least, we’re always interested in hearing about our user’s experiences with The Events Calendar and would be stoked if you wanted to leave a review on our WordPress page.

    Thanks again – and good luck ๐Ÿ™‚

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Facebook Event Times and Link Back To Event’ is closed to new replies.