Support

Home Forums Event Espresso Premium posting registration URL to Facebook …

posting registration URL to Facebook …

Posted: January 25, 2016 at 1:39 am


Angus Russell

January 25, 2016 at 1:39 am

or faceache, as one of my colleagues calls it!

Anyway, I’ve searched and read the forum posts on this, and luckily in order to create autoposting suing Zapier & IFTTT I do create a post for every event.

So, following instructions from the forum posts I paste the WP post URL and all I get is the event title and ” …. continue reading”, I then have to add the graphic separately.

I can save the trouble by adding the event graphic to the FB post, and then pasting the event registration URL directly into the text of the FB post. Saves me the step of opening the WP post to copy the URL.

OR, am I missing something entirely? Now having this problem with 2 MTB events, one has correct graphic, wrong text, the other has both incorrect, when pasting the event rego URL into an FB post.

Please advise if there are any other alternatives.

Many thanks
Angus


Angus Russell

January 25, 2016 at 1:49 am

realised that the featured graphic is not included in the WP post, so how can I make that happen?

Then presumably the WP post will show the featured image, which will then show in the FB post?

Thanks


Josh

  • Support Staff

January 25, 2016 at 12:53 pm

Hi there,

Another alternative is use EE3’s built in auto post feature. It will create a post for every event without using any additional plugins.


Angus Russell

January 25, 2016 at 9:13 pm

Hi Josh,

I am using the autopost feature, at the bottom of the event setup page.

However, it is not including the featured image in the WP post, which is presumably why the FB post of the WP post URL also has no image?

Thanks


Josh

  • Support Staff

January 26, 2016 at 10:08 am

Hi Angus,

That’s correct. You can sync the featured image from the event to the event blog post when the event is created and updated with the set_post_thumbnail WordPress function. Here’s a code example that shows how:

https://gist.github.com/joshfeck/da54b92ecf709341c26a

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.


Angus Russell

January 28, 2016 at 9:26 am

OK, so tried that but the file doesn’t show in plugins.

I went to wp-content/plugins/Custom-Plugin-Snippets whic is my folder for odds & ends and has the last snippet; a currency one to show AED in place of USD.

Followed the guide you gave but the file never showed up in the PLugins Editor in the admin window.

Refreshed pages, even moved it directly into the plugins folder.

Thanks


Josh

  • Support Staff

January 28, 2016 at 9:41 am

Hi Angus,

I can recommend removing the file and instead, copy the function and the callback into your plugin’s main file.


Angus Russell

January 28, 2016 at 10:09 am

OK thanks – but what do you mean by the main file? the index.php in the plugins folder?

thanks


Josh

  • Support Staff

January 28, 2016 at 10:22 am

No, the main .php file in wp-content/plugins/Custom-Plugin-Snippets.


Angus Russell

January 28, 2016 at 10:25 am

there’s only the currency file in there.

so, the file should also be a general file, not separate ones each time?

thanks


Angus Russell

January 28, 2016 at 10:32 am

<?php
/*
Plugin Name: AED Currency Symbol
Description: Site specific code for supersportsevents.me
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

function ee_change_dollar_to_aed( $content ) {

global $org_options;

$content = str_replace( $org_options[‘currency_symbol’], ‘AED ‘, $content);

return $content;

}

add_filter( ‘the_content’, ‘ee_change_dollar_to_aed’, 11 );

/* syncs EE3 event featured image to event’s blog post */
add_action( ‘action_hook_espresso_insert_event_success’, ‘my_ee3_event_image_function’ );
add_action( ‘action_hook_espresso_update_event_success’, ‘my_ee3_event_image_function’ );
function my_ee3_event_image_function( $event_data ) {
global $wpdb;
if ( isset( $event_data[‘upload_image’] ) && ! empty( $event_data[‘upload_image’] ) ){
$image_url = $event_data[‘upload_image’];
$image_url = preg_replace( ‘/-\\d+[Xx]\\d+\\./’, ‘.’, $image_url );
$attachment = $wpdb->get_col( $wpdb->prepare( “SELECT ID FROM $wpdb->posts WHERE guid=’%s’;”, $image_url ) );
if ( ! empty( $attachment ) ) {
$attach_id = $attachment[0];
$post_id = $event_data[‘post_id’];
set_post_thumbnail( $post_id, $attach_id );
}
}
}

/* Stop Adding Functions */


Angus Russell

January 28, 2016 at 10:34 am

when I update in plugins editor, it says no such file exists, but still loads the update, based on checking through the AMP of the server.

However, when I update the event, still nothing in the WP post; or do I need to start again?

Thanks


Josh

  • Support Staff

January 28, 2016 at 10:44 am

Two things:

1) You should make file edits using SFTP/FTP. The built in plugin editor inside WordPress is not the right tool for this job.

2) When you upload the featured image in the event editor, you need to make sure you’re setting the Link URL to the File URL, not to the attachment post URL or anything else.


Angus Russell

January 28, 2016 at 10:52 am

1. Yup I do, just was playing with WP Editor too.

2. Appears to do so by default – http://supersportsevents.me/wp-content/uploads/2016/01/Banner-900×250-60K-2.jpg

OK, removed image, removed post by updating event, reloaded image ensured File URL, chose auto-post, and still no image.

Next 🙂


Josh

  • Support Staff

January 28, 2016 at 11:08 am

Beyond making sure your plugin is activated, I’m afraid I’m all out of suggestions at the moment. The code I shared with you works on the sites I’ve tested it on.

The support post ‘posting registration URL to Facebook …’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso