Hello,
Sorry to read this Don, I’ll do my best to help you.
The code goes in /wp-content/themes/your-child-theme-name/functions.php.
My previous code doesn’t work because the forum editor has replaced the symbol : ‘ by ’. Sorry I can not edit the post so I try to paste it again with more details:
function my_styles_and_scripts() {
// Remove Events Manager files where they are not needed
if( !is_page( array ('events', 'locations', 'new-event') ) && !is_singular(array('event', 'location') ) && !bp_is_current_component('events') ) {
wp_dequeue_style( 'events-manager' );
wp_dequeue_script( 'events-manager' );
}
// Add Events Manager files on these pages
if( is_page( array ('events', 'locations', 'new-event') ) || is_singular(array('event', 'location') ) || bp_is_current_component('events') ) {
wp_enqueue_script('jquery-core');
wp_enqueue_script('jquery-ui-core');
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style( 'events-manager' );
wp_enqueue_script( 'events-manager' );
}
}
// 100 is the priority, please increase this number if this script do not work
add_action( 'wp_enqueue_scripts', 'my_styles_and_scripts', 100 );
Please replace the slug of my pages by yours after if( is_page( array (‘the-slug-of-the-page’, ‘the-slug-of-the-page’, ‘the-slug-of-the-page’) )
is_singular(array(‘event’, ‘location’)) check if this is the event or location post type.
bp_is_current_component(‘events’) check if this is the Events BuddyPress component. So you can remove this part if you are not using the BuddyPress plugin or the Buddyboss platform.
People who use the map will have to add more files depending on the plugin they use. It is not included in my exemple.
Please let me know if you need more details.
Kind regards