Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active November 18, 2015 01:26
Show Gist options
  • Save lorenzocaum/17ecdad637d50e56c6a1 to your computer and use it in GitHub Desktop.
Save lorenzocaum/17ecdad637d50e56c6a1 to your computer and use it in GitHub Desktop.
How to enable sharing buttons for Jetpack on Event Espresso 4 single event pages

Add the sample code below to your child theme's functions.php file or in a site specific plugin.

<?php
//* Do NOT include the opening php tag

//* Enable Jetpack on single event pages
function ee_enable_jetpack_social_sharing_single_event_pages() {
if ( 'espresso_events' == get_post_type() && is_singular() && !post_password_required() ) {
	if ( function_exists( 'sharing_display' ) ) {
		sharing_display( '', true );
	}
}
}
add_action( 'AHEE_event_details_before_the_content', 'ee_enable_jetpack_social_sharing_single_event_pages' );
@lorenzocaum
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment