Last active
July 21, 2022 21:06
-
-
Save norewp/24916330bdade583616393144d719a15 to your computer and use it in GitHub Desktop.
Custom scripts only on the Elementor Canvas template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // You probably don't need to add this opening PHP tag! | |
function my_custom_canvas_scripts() { | |
$classes = get_body_class(); | |
if ( in_array( 'page-template-elementor_canvas', $classes ) ) { ?> | |
<script type="text/javascript"> | |
<!--[Custom Script]><!--> | |
//(function($) { //Uncomment this for no conflict jQuery | |
// Add your script here | |
//})(jQuery); //Uncomment this for no conflict jQuery | |
<!--[End Custom Script]><!--> | |
</script> | |
<?php | |
} | |
} | |
add_action( 'wp_footer', 'my_custom_canvas_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment