You have two issues here:
- Conditional tags (
is_single()
) should not be used so early infunctions.php
. - Your removal function is getting hooked to run after function it’s meant to remove.
It should be something like this:
function remove_shc() {
if ( is_single( array( 17, 19, 1, 11 ) ) )
remove_action( 'wp_print_scripts', 'wp_shc_head_scripts' );
}
add_action( 'wp_enqueue_scripts', 'remove_shc' );
Related Posts:
- Enqueue scripts in footer
- Add default value from selection
- How to include PHP files in plugins the correct way
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- ajaxurl not defined on front end
- How to add a javascript snippet to the footer that requires jQuery
- Why does WordPress add 0 (zero) to an Ajax response?
- How to enqueue JavaScripts in a plugin
- How to include jQuery and JavaScript files correctly?
- Passing arguments to a admin menu page callback?
- function deactivate_plugins does not exist
- What is an alternative method to the WordPress private _doing_it_wrong() function
- Load js/css files only on specific admin UI pages
- Understanding WordPress functions’ naming conventions
- Get list of scripts / styles and show file which enqueued them
- Using OOP plugin’s methods throughout the website
- jQuery in header or footer
- Enqueue script only when shortcode is used, with WP Plugin Boilerplate
- How do I conditionally enqueue script for CPT single post type with plugin?
- Where to enqueue stylesheets for plugin?
- function triggered by “manage_users_custom_column” filter not working
- How can I change the frequency of a scheduled event?
- WordPress plugin how to run function when button is clicked
- When is it appropriate to put functions on page template vs. functions.php?
- Shortcodes, output buffering, and WordPress functions
- How can i list current author’s categories?
- Determine which theme location a wp_get_nav_menu_items is for
- When to check if a function exists
- Checking for existence of a page by title?
- When is it too late to call the action wp_enqueue_scripts?
- Use js script from one plugin in another plugin
- Dynamically Override Fancy Title
- Problems with removing admin bar
- Problem with `wp_mail()`
- Calling a function from functions.php in custom page/ blog post
- Script won’t load via plugin class
- Plugin Loading Scripts and Styles on Every Page – Even when not being used
- Check if I am in the Admin Panel (wp-admin)?
- What is the Difference between directly call a function and call a function using add_action?
- Call to undefined function get_blog_option()
- What is the difference between current_page_parent and current_page_ancestor?
- Plugin development: is adding empty index.php files necessary?
- Undefined function wp_set_password
- Does add_filter work outside functions.php
- What function to hook for changes made in status and visibility of a post
- Inserting JS snippet in the footer if there is no wp_footer?
- Can’t get JS code to work with shortcode
- how to use preg_replace for wordpress video?
- How do you output enqueued scripts to an admin page?
- How do I add a javascript file to all admin pages via a plugin?
- Multisite plugin development and wp_enqueue_script
- Plugin Uninstall and Deactivate via Options Menu
- is_page() function doesnt working
- How can I add a CSS rule to edit.php?
- wp_enqueue_script + wp_enqueue_style Since When
- How to avoid loading same script twice?
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Widget update function not saving values
- Avoiding Duplicate function names in Post Loop (WP_Footer script)
- add more custom post types and custom role to the code
- $content variable – Is this a reserved variable for a WordPress function? – php / wordpress
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- WordPress after content Hook & external template part
- Loading scripts with wp_register_script and wp_enqueue_script
- override pluggable.php functions
- Retrieve contents/page names of various pages for use in a plugin
- Adding Dropbox dropin js using wp_enqueue_script
- Can wp_list_comments output into variable?
- Where to call wp_enqueue_script in a plugin with custom template?
- is user logged in not working
- Can I change header.php of current theme through a plugin function?
- Replacing Scripts in Admin Load_Scripts
- get_current_screen() return null
- Is there a way to ensure plugin script loads before another script?
- Override class inside $atts shortcode_atts in WordPress
- creating custom function to log actions in plugin
- add_rewrite_rule works in themes function php but when moved into plugin it stops working
- Maximum lifetime for nonce
- Where can i find wordpress auto update code flows?
- conditionally load javascript & CSS for do_action() calls from plugin
- What stylesheets are available in core?
- Adding option to Gallery shortcode
- correct way to call javascript into hook function
- How to change the hover content of a specific menu item on WordPress?
- how to search users by ajax live search
- Remove unwanted elements for a wp_nav_menu
- How do I update a field of a meta box?
- How to enqueue or include json file to a plugin
- How to add user details to different tables immediately after user registration
- mysql_real_escape_string() vs. esc_sql() in WordPress
- How to load library scripts in admin from plugins in noConflict wrapper?
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- Checking for existence of a page by title?
- how to get context information inside my funcion
- Enqueue script globally
- WordPress class, using add_action to call member function does not work
- How to modify files inside wp-includes directory in wordpress
- Fatal error: Call to a member function get_page_permastruct() on a non-object
- wp_get_post_terms Order by not working