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
- WordPress REST API and Backbone JS
- Modify Gutenberg blocks quick inserter defaults
- Deregister Custom the_title Filter for edit_post_link
- custom post filter based on Visitors country
- Filter a custom post type by custom field in admin
- How to correctly override a filter?
- Is there a way to check if the ‘wp_sitemaps_enabled’ is true or false?
- How to use filter in this situation, can not modify the structure using filter
- Block Gutenberg Editor manually by User Roles with a Filter with code
- Is it possible to dynamically change the “page_for_posts” option?
- Change password reqts with NO plugin without breaking resetpass link?
- Using the REST API filter, including two meta_queries breaks the response for one custom post type
- Modal pop-up HTML code works on other sites or HTML viewers but not in the custom HTML block within a wordpress page?
- How can I conditionally add the filter option_home?
- How to remove pop up on website (css changes not visible)?
- how to add contact form 7 shortcode in javascript variable
- Search and Filter Using Custom Post Type, Custom Taxonomy, and Advanced Custom Fields
- Adding filter to the Contact Form 7 response
- Remove rel=”ugc” from links in comments
- posts_results filter – additional sort, with a meta value, to move posts to the end of the results, with pagination working
- How to use parse_query() to add an additional filter based on content to page search?
- FacetWP was unable to auto-detect the post listing : Having an issue with ACF load choices causing FacetWP error
- How to change content hash value, within the_block_template_skip_link action?
- add_filter – create_function pb in PHP8
- How to apply_filter / add_filter within 2 others (simultaneous?) add_filter
- How to Dynamically Switch WordPress Front Page Without Causing Canonical Redirect?
- Change or replace user_profile_picture_description filter, to stop stripping whitespace
- Woocommerce price filter widget always shows max price of most expensive product in the whole shop
- Sudden ERR_HTTP2_PROTOCOL_ERROR on every JS and CSS files loads
- remove_function method removing next priority action too while removing current priority
- Are blocks that are converted to patterns no longer filterable through the_content?
- How to optimise Text to HTML ratio for SEO by separating the HTML into multiple files?
- How to use add_filter to add the extra data to existing array?
- wc_get_template_part filter not working
- Override theme hamburger menu to work without javascript (noscript)
- hook on the_excerpt
- hide specific css and js files in specific page wordpress with id or without?
- Separate typography controls for titles and meta in a custom block?
- Deactivate code made with add_filter
- Why wordpress doesn’t allow to add author filter to media library page in grid mode
- opening and closing elementor-widget-container
- ‘Problem’ with login_redirect filter – why does it lose the redirect_to parameter
- unable to find the document body in user-edit admin using javascript or CSS
- difference between code for admin, user facing (css, js)
- Identify and style the paragraph beginning w/o a class: based on a combination of common characters (CSS, JS)
- How do I remove/hide embed excerpts from posts
- Is there a way to override only a portion of the function print_media_templates defined in wp-includes\media-template.php?
- How could I create real-time filtering in this case?
- How to filter products by category in custom loop
- How to use render_block filter in Gutenberg when editing a page?
- “Invalid parameter(s): attributes” issue in context of “blocks.registerBlockType” filter
- How do I query Pending posts?
- Embed dynamic media query in a Gutenberg block
- How to override hook from themes functions.php which is defined in plugin
- How to increase comment length?
- Load More : Admin Ajax 400 Bad request, returning 0
- Block style variations not enqueued for blocks inside HTML code dynamically rendered via JS
- wp reset password page – head inline script
- add_filter( ‘user_has_cap’,’my_function’, 10, 3 ); and call to get_users in my function triggers an infinite loop in user list
- Custom updater to change plugin version