Home › Forums › Calendar Products › Event Aggregator › Facebook Event Times and Link Back To Event
- This topic has 6 replies, 2 voices, and was last updated 11 years, 11 months ago by
Barry.
-
AuthorPosts
-
April 22, 2014 at 5:51 pm #139965
amplifiedsteve
ParticipantI 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
April 23, 2014 at 8:33 am #140461Barry
MemberHi 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 ๐
May 4, 2014 at 7:07 pm #149829amplifiedsteve
ParticipantHi 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
SteveMay 5, 2014 at 7:44 am #150303Barry
MemberThis 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?
<?phpMay 5, 2014 at 8:11 am #150333amplifiedsteve
ParticipantHey 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.
CheersMay 5, 2014 at 8:11 am #150335amplifiedsteve
Participantps. i’ve marked this as resolved. thanks
May 6, 2014 at 6:13 am #151569Barry
MemberNo 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 ๐
-
AuthorPosts
- The topic ‘Facebook Event Times and Link Back To Event’ is closed to new replies.
