How to deregister scripts all at once

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(); } add_action(‘wp_print_styles’, ‘remove_all_styles’, 100); ?> It will remove all the scripts enqueued by standard method. Manual … Read more

Plugin’s required JS not being inserted in my theme

Hey by using enqueue script to add all js and css file wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ); Example here /** * Proper way to enqueue scripts and styles */ function theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/example.js’, array(), ‘1.0.0’, true ); } add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ ) i am sure … Read more

Disable load scripts and styles not working

Try the following: function mytheme_deregister_scripts_and_styles(){ $unwanted_scripts = array( ‘photocrati_ajax’, ‘photocrati-nextgen_basic_thumbnails’, ‘photocrati-nextgen_basic_extended_album’ ); foreach ( $unwanted as $script ) { wp_dequeue_script( $script ); wp_deregister_script( $script ); } $unwanted_styles = array( ‘style_1’, ‘style_2’ ); foreach ( $unwanted_styles as $style ) { wp_dequeue_style( $style ); wp_deregister_style( $style ); } } add_action( ‘wp_enqueue_scripts’, ‘mytheme_deregister_scripts_and_styles’, 99 ); It looks like … Read more

WordPress menus – automatically generate

Use the WP database (via proper methods) to store a ‘is this the first run’ flag? Then just conditionally execute. check for flag in wp db if exist do nothing if not exist create me my menus dag nammit remember to set flag for next round so its only done once Something like that? If … Read more

Dequeue set-post-thumbnail.min.js

You should be able to dequeue like normal. Despite the complexity of the function, it is really just enqueueing scripts and styles. Tested with the admin bar script on the front end: add_action( ‘wp_enqueue_scripts’, function() { wp_dequeue_script(‘admin-bar’); } ); You just want admin_enqueue_scripts and set-post-thumbnail: add_action( ‘admin_enqueue_scripts’, function() { wp_dequeue_script(‘set-post-thumbnail’); } ); I am not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)