Dequeue styles with query doesn’t work

Thank you very much @Tom J Nowell and @Sally CJ . As you pointed out, it worked with the below: function remove_inline_style(){ if ( is_page( ‘live’ ) ){ remove_action( ‘wp_enqueue_scripts’, array( Design_Scheme::get_instance(), ‘header_style_css’ ), 11 ); } } add_action( ‘wp_enqueue_scripts’, ‘remove_inline_style’); thank you for your help.

wp_enqueue_script was called incorrectly. Scripts and styles

Of course I’m unable to answer you exactly, because I don’t see a full functions.php code. You can use wp_enqueue_scripts action hook with both, scripts and styles. Do not call wp_enqueue_script and wp_enqueue_style outside of wp_enqueue_scripts hook. add_action(‘wp_enqueue_scripts’, ‘wp_enqueue_scripts_callback’); function wp_enqueue_scripts_callback(){ wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘thickbox’ ); wp_enqueue_script( ‘media-upload’ ); wp_enqueue_script(‘smoothscroll’, get_bloginfo(‘stylesheet_directory’).’/includes/js/smoothscroll.js’, array(‘jquery’), ”); wp_enqueue_script(‘marker’, … Read more

localize_script but data changes dependent on product ID

You should call wp_localize_script() in the wp_enqueue_scripts hook (or a later hook) in which you would get the correct product/post data such as ID, and that conditional tags like is_single() would also work as expected. So you should move all the $product, $product_id, $dataToBePassed and wp_localize_script() parts to inside the wp_enqueue_scripts callback, and then you’d … Read more