How to remove some external js files from source?

You can use wp_dequeue_script to achieve this assuming they are using wp_enqueue_script to add the scripts in the first place. Learn more about enquene and dequeue: https://developer.wordpress.org/reference/functions/wp_enqueue_script/ https://codex.wordpress.org/Function_Reference/wp_dequeue_script function dequeue_script() { wp_dequeue_script( ‘http://buhehe.de/wp-content/themes/heatt/js/small-menu.js?ver=4.9.1’ ); wp_dequeue_script( ‘http://buhehe.de/wp-includes/js/wp-embed.min.js?ver=4.9.1’ ); } add_action( ‘wp_print_scripts’, ‘dequeue_script’, 100 );

How to enqueue script based on post category?

Inside your theme’s functions.php add something like this: function my_conditional_enqueue_script() { global $post; if (is_single($post->ID) && in_category(‘mouse’, $post->ID)) { wp_enqueue_script(‘mousescript’); } } add_action(‘wp_enqueue_scripts’, ‘my_conditional_enqueue_script’); Also, make sure you use wp_register_script before you attempt to enqueue.

Enqueue scripts to footer

Like this:- function dequeue_my_scripts() { wp_dequeue_script(‘dgx_donate_paypalstd_script’); wp_dequeue_script(‘next-handle-script’); wp_dequeue_script(‘next-handle-script-2’); /* and so on*/ } add_action( ‘wp_print_scripts’, ‘dequeue_my_scripts’, 11 ); function enqueue_scripts_to_footer() { wp_enqueue_script(‘dgx_donate_paypalstd_script’); wp_enqueue_script(‘next-handle-script’); wp_enqueue_script(‘next-handle-script-2’); /* and so on */ } add_action( ‘wp_footer’, ‘enqueue_scripts_to_footer’ ); What’s wrong in this implementation? EDIT: I would also like to notify you that this is the correct implementation of what … Read more

How to dequeue / deregister parent theme style

It is pretty simple: function remove_nada_theme_font_style() { remove_action( ‘wp_enqueue_scripts’, ‘nada_theme_styles’ ); } add_action( ‘after_setup_theme’, ‘remove_nada_theme_font_style’ ); Since the child theme is loaded before the parent theme, you can’t simply remove the action. because the add_action calls in the parent theme will simply overwrite your requests. You have to wrap it into the after_setup_theme hook. This … Read more

chosen jquery library not loading – is not a function error

You forgot to load chosen library: wp_register_script( ‘js_chosen’, ‘https://raw.github.com/harvesthq/chosen/master/chosen/chosen.jquery.js’, array(‘jquery’) ); wp_register_script( ‘js_custom’, plugin_dir_url( __FILE__ ) . ‘js/jquery.js’, array(‘jquery’, ‘js_chosen’) ); wp_enqueue_script ( ‘js_custom’ );

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