Home › Forums › Ticket Products › Eventbrite Tickets › Regarding Featured Image
- This topic has 5 replies, 2 voices, and was last updated 9 years ago by Barry.
-
AuthorPosts
-
March 5, 2015 at 10:56 am #946241Ian GarlicParticipant
Hello,
I am really enjoying the events calendar. It functions without any problems both on import and export of events from eventbrite. However, one of my clients will be working with events on both eventbrite and wordpress. He creates the event in eventbrite and adds the featured image through eventbrite which then shows up on the right side of the eventbrite page.
The issue is that when we import the event into wordpress we need to add a featured image to show up as a thumbnail for the event. On updating the page the image we set in wordpress is pushed to eventbrite in a custom header as html code. This is bad because the image is often blown out of proportion or not needed. How can I disable the ability to export WordPress’s featured image to eventbrite? Any advice would be very appreciated.
March 5, 2015 at 2:58 pm #946366BarryMemberHi Ian,
I believe the following short snippet (which you might for instance add to your theme’s functions.php file) should do the trick:
add_filter( 'tribe_events_eb_request', 'kill_sending_img_to_eb' ); function kill_sending_img_to_eb( $request ) { $start = strpos( $request, 'custom_header' ); if ( false === $start ) return $request; $end = strpos( $request, '&', $start ); return substr_replace( $request, '', $start, ++$end - $start ); }
It’s fairly crude and you could potentially refine things, but why not give it a try and see if it fits the bill?
March 9, 2015 at 9:22 am #946966Ian GarlicParticipantBarry,
I tried placing the code you provided into my functions.php file but the featured image from WordPress is still being placed in Eventbrite’s custom head section. Any other ideas would be greatly appreciated.
Thanks
March 9, 2015 at 10:20 am #946987BarryMemberHi Ian,
Apologies there, can you try this revised version:
add_filter( 'tribe_events_eb_request', 'kill_sending_img_to_eb' ); function kill_sending_img_to_eb( $request ) { $start = strpos( $request, 'custom_header' ); if ( false === $start ) return $request; // $end may be false if the custom header value is the last part of the URL query $end = strpos( $request, '&', $start ); $len = ( false === $end ) ? strlen( $request ) - $start + 1 : ++$end - $start; // Remove the custom header key/value from the query return trim( substr_replace( $request, '', $start, $len ), '&' ); }
I hope that helps!
March 9, 2015 at 12:27 pm #947016Ian GarlicParticipantWorked like a charm. You guys are awesome, thanks!
March 9, 2015 at 3:08 pm #947076BarryMemberOur pleasure, and apologies for the hiccup along the way 🙂
I’ll go ahead and close out this topic, but if we can assist with any other issues please don’t hesitate to post new threads as needed.
Thanks again!
-
AuthorPosts
- The topic ‘Regarding Featured Image’ is closed to new replies.