Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Custom scripts only on the Elementor Canvas template
<?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]><!-->
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