cody123
Forum Replies Created
-
Forum: Plugins
In reply to: [Import Social Events] Link to facebook eventHi @sophiesaxlund,
This can be placed anywhere you need a link to the post in your code. It can’t be used in the WP content editor or in the backend of WP. I would ask the plugin author to add this feature if you need it, or write a function that outputs that code and put it in functions.php
I wouldn’t suggest changing the base plugin code @lisha56, as it will be overwritten on update and can also cause further issues down the road. I personally recommend writing a function that will output the link based on the post ID that can be placed in functions.php.
Forum: Plugins
In reply to: [Import Social Events] Link to facebook eventSorry, I put the PHP close tag after the HTML. The proper markup would be:
<?php $event_id = get_the_ID(); $facebook_id = get_post_meta( $event_id, 'ife_facebook_event_id', true ); ?> <a target="_blank" href="https://www.facebook.com/event/<?php echo $facebook_id; ?>">View Event on Facebook</a>
Forum: Plugins
In reply to: [Import Social Events] Link to facebook eventI had the same problem today and managed to figure it out after digging around in the plugin’s files.
When an event is imported, the ID is saved in the meta data of the post. You can retrieve it by using the
ife_facebook_event_id
meta value stored in each post.For example:
<?php $event_id = get_the_ID(); $facebook_id = get_post_meta( $event_id, 'ife_facebook_event_id', true ); <a target="_blank" href="https://www.facebook.com/event/<?php echo $facebook_id; ?>">View Event on Facebook</a> ?>
Hope this helps anyone facing this issue. I would recommend updating the docs for this plugin to include this, as it’s a commonly used variable and feature. Great plugin!
Cheers,
Cody