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
- Angular: conditional class with *ngClass
- CSS Animation onClick
- Change an image with onclick()
- Solutions for generating dynamic javascript / CSS
- How to show page content in feed?
- remove_filter( ‘the_content’, ‘wpautop’ ); only for certain post types
- Can I add custom meta for each image uploaded via media-upload.php?
- Load different template file when condition met?
- How to combine multiple CSS files and concatenate JavaScripts if WordPress recommends enqueuing them?
- Problem getting single_template filter to work – I want to serve a different single.php file for posts in a certain category
- Too many actions/filters!
- How can override a add_filter of a plugin?
- Nested calls the the_content filter
- How to change domain used when pinging sites
- Return a custom value in a function added to an action hook
- Multiple filters for wp_get_archive
- Filter and modify entry-footer link in twentyseventeen
- Function the_content not working
- Extending body classes in front- and backend
- Break out of wordpress filter
- Slider loading issue
- Are there actions or filters I can use for Ajax calls?
- To add a custom filter based on a meta field
- How to create Woocommerce Product Filter Widget [closed]
- Add default user field to WooCommerce checkout [closed]
- Filtering Comment Reply Links (comment_reply_link_args) for “infinite replies” in nested comments
- Create Search Form to Filter Through Terms
- Upload restrictions – upload_mimes – filter: Adding multiple MIMEs for a single extension and adding multiple extensions for a single MIME type?
- Conditional does not work with add_filter
- Add class to DIV depending on page loaded
- trouble with page_id & highlighting current page
- Pass debug_backtrace() in WordPress filter
- Set “woocommerce_is_purchasable” to false for specific “$product->is_stock_status”
- WordPress theme resource won’t load over VPN
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- I need to hook and change language of facebook sdk
- change “missing attachment” text functions.php
- Shorten the title length
- Problem with Class, Filters and Callbacks
- Conditionally print css style in WordPress
- Renaming wordpress login and get new password button
- Parse a shortcode differently based on on what it’s nested in
- How do I override all stylesheets and scripts without a plugin
- How to redirect template_directory to subdomain relativ url?
- add_filter( ‘the_title’ gets through this if statement twice
- Changing the category for existing Gutenberg blocks
- How do I integrate vanilla Javascript to a wordpress website?
- Modify WordPress Page Title ()
- How to add lazy field in content endpoint using Gutenberg blocks
- how to use apply filter for Class?
- Re-order search results with posts_orderby filter and post meta value
- Set Microsoft Word links to open in new window/tab
- WordPress get_avatar filter to match logins
- ‘the_content’ Filter delivers empty string with lengh (608)
- Output dynamic_sidebar_params in wp_head
- How to sort posts according to meta value?
- Change shortcode output (filter?)
- Updating User Profile on Registration
- remove_filter excerpt_more from a plugin class
- Why does using excerpt_more filter change link location?