If you want to dequeue scripts & styles for a specific page based on the slug of the page. You can get the slug in various ways and use it instead of $_SERVER['REQUEST_URI']
.
Use if( is_page( array( 'my_page')
instead of if(basename($_SERVER['REQUEST_URI'])=='my_page')
function wpse_289574_dequeue_scrips() {
if(is_page( array( 'my_page')){
wp_dequeue_style( 'taxonomy-image-plugin-public' );
...
}
}
How to get the slug of a page:
$qo = $GLOBALS['wp_the_query']->get_queried_object();
$cp = sanitize_post($qo);
$slug = $cp->post_name;
Taken from: How to retrieve the slug of current page?
function wpse_289574_dequeue_scrips() {
if($slug =='my_page'){
wp_dequeue_style( 'taxonomy-image-plugin-public' );
...
}
}
Current hook to dequeue is wp_enqueue_scripts
.
Related Posts:
- How do I get the $handle for all enqueued scripts?
- How can I get a list of all enqueued scripts and styles?
- How to properly dequeue scripts and styles in child theme?
- How to load JQuery easing script in wordpress?
- How to remove some external js files from source?
- Select2 in WordPress
- wp_enqueue_script with dependencies doesn’t work
- Help with enqueing scripts in footer after init action
- How to load script-related styles automatically?
- How to cancel `wp_print_scripts`?
- How do I enqueue a JavaScript in my footer via the functions.php file?
- Retrieve URL of Script/Style and Dependencies
- Is there a way to list all the JavaScript scripts that are actually loaded by WordPress? Do we care?
- Styles and scripts inside template part
- why quotes shown in WordPress?
- Enqueuing a script before anything else
- wp_enqueue_script was called incorrectly Issue when active plugins of WordPress Admin Bar Improved
- is there a way to get all queued scripts/styles into a template without `get_header()`?
- How do I pass $in_foooter to wp_enqueue_script() without passing other params?
- How to get, in WP page’s script, a wp enqueued script (in Functions.php)?
- How do I display the handle for all front-end enqueued scripts in plugin options page?
- When should I use wp_register_script() with wp_enqueue_script() vs just wp_enqueue_script()?
- wp enqueue inline script due to dependancies
- How do I dequeue a parent theme’s CSS file?
- Check if a script/style was enqueued/registered
- wp enqueue style on specific page templates
- Is it possible to use wp_localize_script to create global JS variables without a specific script handle?
- How to load css in the footer [duplicate]
- Load CSS/Javascript in frontend conditionally if block is used
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- Register a script to be enqueued both in admin and front end
- How can I enqueue protocol relative external (//ajax.googleapis.com/…) scripts?
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- Can’t enqueue scripts in the footer?
- How can I remove the site URL from enqueued scripts and styles?
- How can I de-register ALL styles all at once? And same with Javascript?
- What are the benefits of using wp_enqueue_script?
- Loading a script with a dependency, is unloading another script’s dependency
- Correct Method to run scripts with dependencies without enqueue?
- wp enqueue script using scripts from cdn with a safety callback
- Can I add styles to footer with $wp_styles->add_data?
- Cannot deregister a script using wp_deregister_script
- Conditional wp_enqueue_script on a page
- Enqueue custom font file with rel=”preload”
- Protocol neutral URLS with wp_enqueue_script (SSL issues)?
- Get list of scripts / styles and show file which enqueued them
- Enqueue script in specific page
- Removing specific style from wp_head
- How to dequeue / deregister any theme styles and scripts
- How to en-queue bootstrap 4 to theme?
- Notice that the wp_enqueue_style is not being called correctly!
- Why is jquery-ui-core enqueueing in my footer instead of the header?
- Is it safe/recommended to use wp_enqueue_script function outside the functions.php file?
- wp_enqueue script my_javascript_file in the footer
- Hyphens vs. periods in the script slug in wp_register_script?
- How to get a jQuery script to run on a page?
- jquery script not enqueued in child theme
- Using wp_enqueue_script on shortcode function handler
- Get the list of enqueued/registered scripts for a specific post?
- Enqueue script only for IE
- Hook for writing text string after footer scripts
- Is This The Most Efficient Way To Add Javascript Files?
- Why does this line of code make photo albums appear?
- Add script to footer – on post editor
- Which action to hook wp_enqueue_script to? wp_head or wp_enqueue_scripts? [duplicate]
- wp_register_script multiple identifiers?
- enqueue and localize script in footer
- Issue with using Underscore in WordPress
- Conditionally dequeue dependency of scripts
- Trying to load different syles for 404.php page
- Enqueue Script with URL parameters
- What determines the order of enqueued styles?
- Track down where script is being enqueued from
- $wp_styles->registered not giving ALL the styles?
- Wp_head and wp_footer vs wp_enqueue_script javascript files?
- Benefits to enqueuing site scripts/stylesheets?
- Enqueue script only if page has an oembed
- Adding Custom Javascript to Skeleton Child Theme
- It would be a right way to enqueue the script using foreach loop?
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- Is this a bad implementation of wp_enqueue_script for conditional usage?
- Preload key requests using wp_enqueue
- Including javascript for a shortcode
- Don’t load scripts if on mobile/tablet
- Trigger a php file on every post or page if a condition is met
- How do I load custom scripts and styles for a page?
- How to Add a Custom Script to Customize.php
- Remove a script from a template file using wp_dequeue_script
- Problem in wp_localize_script
- Remove specific CSS and JS from the head
- wp_enqueue_script vs. wp_register_script
- How do I enqueue(or delay loading of) tags in individual page posts?
- Enqueue scripts to a specific header-.php?
- Adding dependencies to script enqueing
- Which are the MediaElement.js scripts to enqueue
- Child Theme – what is the scope of overwriting files?
- Best way to enqueue extremely popular scripts like bootstrap and font awesome
- How to dequeue / deregister parent theme style
- Enqueue scripts to footer
- Enqueued scripts and styles loading in WordPress Dashboard as well