Does it work any better added to a hook with the conditionals inside?
function my_deregisters() {
if ( !is_single() ) {
remove_action('wp_head', 'wp_page_numbers_stylesheet');
//wp_deregister_style( 'fancybox' ); // i think this can be removed
//wp_deregister_script( 'fancybox' ); // i think this can be removed
wp_dequeue_script('fancybox');
wp_dequeue_style('fancybox');
remove_action('wp_print_scripts', 'mfbfw_load');
remove_action('wp_print_styles', 'mfbfw_css');
remove_action('wp_head', 'mfbfw_init');
remove_action('wp_head', 'cforms_style');
}
}
add_action( 'wp_enqueue_scripts', 'my_deregisters', 100 );
Related Posts:
- How to add a custom CSS class to core blocks in Gutenberg editor?
- This code works, but breaks the media uploader. How do I integrate it in a way that won’t?
- How to add defer=”defer” tag in plugin javascripts?
- the_content and is_main_query
- Why is javascript allowed in my post content?
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Adding a class to the body_class function
- AJAX filter posts on click based on category
- Remove left alignment option in core/image block
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- Add classname to the_category() function?
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- Filter out some plugin action in wp head / wp_footer
- Adding Filter Conditionally Per Page ID
- How to remove google font in WordPress for only single page?
- How can I filter block registration based on post-type? (Block alignment settings)
- Where is this inline CSS code [closed]
- Using Conditional Statement in functions.php
- Same Conditionals Not Working on Two Different Hooks
- How to center oEmbedded content
- Add attribute to script loaded by the theme
- Redirect to checkout woocommerce failed
- When to use add_action when registering/enqueuing scripts
- Header image automatically changes depending on season
- Redirect to another page using contact form 7? [closed]
- Change login CSS
- How should I be using filters and is_single together?
- Is there any reason for the nested filters to be applied on the first case and not in the second one?
- How do I add tags to entire comments, not just their text
- “The editor has encountered an unexpected error” After add defer tag to java script
- Add an attribute to the root from functions.php with add_filter
- How to bridge the gap between dynamic back-end data and front-end output?
- adding an action inside if condition not working
- Publish button inside custom field group
- The title of an attachment is not working
- is_page_template() doesn’t work with excerpt_length filter
- How would I remove an inline googleAPI font script in the the parent theme header.php?
- Add a filter conditionally based on frontpage
- Background color and background image below element in Contact Form 7 – error tip [closed]
- Limit total tags in the_content
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- Set timeout for ajax (jQuery)
- CSS height 100% percent not working
- Fully responsive HTML5 video
- Changing JPEG compression depending on image size
- How to add headers to outgoing email?
- LESS CSS enqueue_style with add_filter to change rel attribute
- Remove description from on Home
- How can I detect if a user changes their password?
- Moving sharedaddy buttons (in Jetpack) to the top of a post?
- Add class to woocommerce checkout body based on filter [closed]
- changing variable through filters or action hooks
- Hide Add to Cart Button
- filter the_title problem in nav
- How to replace any occurence of Gravatars with a local placeholder image?
- Ignore dots when searching in the media library?
- What’s the best way to split admin-only functionality in the theme’s functions.php file?
- Why won’t my preg_replace work with content_save_pre?
- How Does comment_author Filter Work?
- Add ‘data-text’ attribute to TagCloud HTML
- Why in archive page doesn´t show read more button with excerpt?
- Empty string supplied as input when parsing content
- How can I remove the kses filters when saving a specific post type ? (it breaks my JSON)
- Remove_action does not work
- How to access plugin variables from theme templates without using globals?
- WooCommerce Custom Product Validation [closed]
- Make WP not format code, not insert line breaks in between tags
- How do I override the_excerpt so that it will display full content?
- Add Codepen animation as Preloader to WordPress
- Cannot set property ‘className’ of null at setThemeFromCookie
- get_post() containing gallery is outputting an unmatched closing div at the end of the content
- Trouble using remove_filter to override function in parent theme
- How do I hook my function to run only after submitting login form
- Prepending character(s) to a custom tag title?
- Modify existing plugin function with add_filter
- include specific Pages to wp_list_pages with filter
- Show/Hide Div for Login Mask
- Email Obfuscation: Is antispambot() Acceptable? [closed]
- What are the steps + prerequisites for using an add_filter?
- an action hook when a post reaches a certain number of views
- WordPress overwrites UNC
- Excluding posts by meta, and also keeping posts without the meta
- Change tags url to search different site
- How to optionally append components to the output of a gutenberg block?
- How to add custom media library mime icons?
- Custom SQL query slows down when using multiple OR … LIKE … in posts_where filter
- get_post() with filters applied
- Drop down filter sort posts by latest, last 7 days and monthly
- Unable to defer loading of jquery
- Override admin selected page layout
- Login logout below menu bar
- Add HTML to the bottom of each post in a post list
- What scope is $blog_url = get_bloginfo() inside a function
- How we make the filter for fornt end user
- Filter dashboard custom post listing by user
- How to filter part of a variable if it is no array?
- WordPress wp_lazy_loading_enabled returns loading attribute set to lazy
- Deregister Custom the_title Filter for edit_post_link
- How to apply_filter / add_filter within 2 others (simultaneous?) add_filter
- How to override hook from themes functions.php which is defined in plugin