Created
November 6, 2020 16:12
-
-
Save BenSibley/64fe485297a1f647e3e860de71433345 to your computer and use it in GitHub Desktop.
Disable Elementor Pro's sticky feature
This file contains 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
function mysite_remove_elementor_pro_sticky() { | |
// Dequeue and deregister elementor-pro-frontend | |
wp_deregister_script( 'elementor-pro-frontend' ); | |
// Re-register elementor-frontend without the elementor-sticky dependency. | |
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; | |
wp_register_script( | |
'elementor-pro-frontend', | |
ELEMENTOR_PRO_URL . 'assets/js/frontend' . $suffix . '.js', | |
[ | |
'elementor-frontend-modules', | |
], | |
ELEMENTOR_VERSION, | |
true | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'mysite_remove_elementor_pro_sticky', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment