Tag Info

New answers tagged

1

Since you ruled out remove_action there is only one way you can do it. And you've guessed it: preg_repalce, substr mixture but with a little help and PHP DOM add_action('wp_footer', 'my_start_footer_ob', 1); function my_start_footer_ob() { ob_start("my_end_footer_ob_callback"); } add_action('wp_footer', 'my_end_footer_ob', 1000); function ...


0

Its already answered on this link <?php //To remove all script from the page function remove_all_scripts() { global $wp_scripts; $wp_scripts->queue = array(); } // to remove all stylesheet add_action('wp_print_scripts', 'remove_all_scripts', 100); function remove_all_styles() { global $wp_styles; $wp_styles->queue = array(); } ...


0

Well of course you can. All you need to find is what handle they are using for those scripts. let's say they are uing plugin-script handle. Then you deregister and register script again with your URL. Like this. function wcs_scripts_styles() { wp_deregister_script( 'plugin-script' ); wp_register_script( 'plugin-script', get_stylesheet_uri(). ...


0

First, create a static js file with those inline codes.. !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0]; if(!d.getElementById(id)){js=d.createElement(s);js.id=id; js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js,fjs);} }(document,"script","twitter-wjs"); var options = { "url": "/my-styles.css" }; ...


0

Following code can be used to add script in footer BUT I should mention here that this is not the recommended way in WordPress. add_action( 'wp_footer', 'custom_footer_script', 100 ); function custom_footer_script(){ ?> <script> // your script </script> <?php } Alternative: Have to tried creating separate script file adding ...


0

add_action( 'wp_enqueue_scripts', 'load_scripts '); function load_scripts() { if ( !is_admin() ) { wp_enqueue_script( 'jquery' ); wp_register_script( 'twitter-customize', get_bloginfo( 'template_directory' ) .'/js/customize-twitter-1.1.min.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'twitter-customize' ); } ...



Top 50 recent answers are included