register_location( 'header' ); $elementor_theme_manager->register_location( 'footer' ); } add_action( 'elementor/theme/register_locations', 'canvi_register_elementor_locations' ); add_action( 'wp_enqueue_scripts', 'canvi_add_required_stylesheets', 20 ); function canvi_add_required_stylesheets() { global $post; if ( function_exists( 'elementor_theme_do_location' ) && isset( $post->ID ) ) { // deregister main styles when page is editiong in elementor and elementor_canvas is selected if ( \Elementor\Plugin::$instance->db->is_built_with_elementor( $post->ID ) && get_page_template_slug() == 'elementor_canvas' ) { wp_dequeue_style( 'canvi-main' ); } } }