I want to use @import instead so I can override styles more easily
Simply. Don’t. Do. That.
You simply jump into the same hook and then deregister/dequeue the styles/scripts and throw in your custom ones.
function PREFIX_remove_scripts() {
wp_dequeue_style( 'screen' );
wp_deregister_style( 'screen' );
wp_dequeue_script( 'site' );
wp_deregister_script( 'site' );
// Now register your styles and scripts here
}
add_action( 'wp_enqueue_scripts', 'PREFIX_remove_scripts', 20 );
The reason for dequeue-ing and deregistering the scripts is simple:
Note that if you’d like to be able to use either of those handles (
'screen'
or'site'
) after dequeuing them, you’ll need to deregister them too. For instance:wp_deregister_style( 'screen' );
andwp_deregister_script( 'site' );
– peterjmag
Related Posts:
- How to dequeue / deregister parent theme style
- Check if a script/style was enqueued/registered
- wp enqueue style on specific page templates
- How to load css in the footer [duplicate]
- How can I get a list of all enqueued scripts and styles?
- Load CSS/Javascript in frontend conditionally if block is used
- How to properly dequeue scripts and styles in child theme?
- Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts
- How can I de-register ALL styles all at once? And same with Javascript?
- Enqueue custom font file with rel=”preload”
- Removing specific style from wp_head
- How to dequeue / deregister any theme styles and scripts
- Notice that the wp_enqueue_style is not being called correctly!
- Hyphens vs. periods in the script slug in wp_register_script?
- jquery script not enqueued in child theme
- Get the list of enqueued/registered scripts for a specific post?
- Trying to load different syles for 404.php page
- What determines the order of enqueued styles?
- $wp_styles->registered not giving ALL the styles?
- Adding Custom Javascript to Skeleton Child Theme
- How to use wp_enqueue_style() and wp_enqueue_script() only when needed?
- Preload key requests using wp_enqueue
- Remove a script from a template file using wp_dequeue_script
- Remove specific CSS and JS from the head
- Child Theme – what is the scope of overwriting files?
- Enqueued scripts and styles loading in WordPress Dashboard as well
- Enqueue styles properly in a child theme and stylesheets location
- Add last modified time as version to css and js
- How can I load script and style in specific page in the back-end?
- Best spot for wp_register_script() and wp_register_style()
- Custom Plugin Development: What priority should wp_enqueue_scripts have?
- How to switch css files according to devices and button click?
- How to control the order of the combination of enqueued styles and scripts – site speed issue
- Register script/style: Is it possible to customize the version query string via plugin?
- Asset loading with gulp.js or Grunt
- How to load script-related styles automatically?
- Optimizing WordPress’s styles and scripts
- Is my child theme working properly
- How to enqueue a style using wp_enqueue_scripts()?
- Deregister scripts on unnecessary pages using remove_action
- Including style.css in Child Theme
- Enqueue Style for a page/pages only
- Why are files enqueued with wp_enqueue_style and wp_enqueue_script 404 Not Found?
- enqueue admin styling and scripts only on plugin page
- using conditionals on enqueue styles
- Including files in Child Themes
- wp_enqueue_script Doesn’t Work?
- Exclude external uri for css and js version
- How to create a child theme with multiple css files.
- How to enqueu php files with custom variable & conditionals?
- Enqueue never runs
- How to enqueue JavaScript file that depends on CSS stylesheet
- How can I properly enqueue tags in WordPress to use with Web Components?
- get_stylesheet_directory() in child theme breaks parent scripts
- Child theme stylesheet not always overriding “index”
- Load same stylesheet for front end and wp-admin
- Enqueueing Scripts and Styles
- Enqueuing a script before anything else
- Enqueue custom css file on specific page
- How to remove all enqueued assets from the active theme?
- How to add conditionals for IE browsers between certain versions?
- Should we explicitely enqueue jQuery and our theme’s main stylesheet?
- wp_enqueue_style referencing parent theme
- Modular CSS and JS in Child Themes
- All of my Scripts and Enques are getting file not found
- How to use wp_enqueue_script, style when required
- Enqueueing Scripts/Styles mid-page
- how to load css and js based on post template
- I want to set global directory locations for my CSS and JS locations. How?
- javascript file is not enqueing
- Enqueueing Scripts and Styles to page template that has html
- FullCalendar in WordPress is not working
- Check for Twitter Bootstrap Loaded
- is there a way to get all queued scripts/styles into a template without `get_header()`?
- How do you load js and style resources from CDN with local fallback using wp_enqueue_scripts?
- Filter enqueued styles and scripts
- Add custom css file after plugin css with WordPress Child Theme functions.php
- WordPress wp_enqueue_style and wp_enqueue_script not working
- Stylesheets and scripts not loading
- Scripts and stylesheets failing to load in Chrome IOS (and only Chrome IOS)
- Enqueue script with version number not working
- How to enqueue a script on a specific URL that contains multiple parts
- i can’t handle any style or Js file on my theme . what is the problem of this file?
- how to fix loading scripts in child theme?
- Should I be enqueueing styles/scripts once and then dequeueing them?
- List all non-admin enqueued files
- Most optimal way of starting fresh, without using other theme or dropping old files?
- custom template – override plugin template in child theme – issue with scripts
- css3-mediaqueries-js failing with child theme
- wp_enqueue doesn’t load dependencies
- wp_enqueue_scripts hangs
- Why do WordPress adds the id=”handle-{js|css}” attribute to scripts and stylesheet?
- Should I use wp_register_style(), wp_enqueue_style, or both?
- Is it safe/recommended to use wp_enqueue_script function outside the functions.php file?
- wp_enqueue script my_javascript_file in the footer
- Track down where script is being enqueued from
- How to override enqueued styles using a child theme
- Deregistering a script in WordPress seems impossible
- Move scripts to footer, but exclude one script?
- Enqueue assets from multiple directories using add_action/do_action