I’d like to override some of the plugins’ styles with my style.css. Is there a way to load it last among all the styles loaded by the theme? I’m currently doing this, but it’s loading the style.css of the theme twice:
// Add default styles and necessary JavaScript for all the pages
function ad_add_styles_and_scripts() {
// Use Inter from Google Fonts
wp_enqueue_style( ‘google-fonts’, “https://fonts.googleapis.com/css2?family=Inter:wght@100;400;700&display=swap” );
// Load the theme's style last
wp_enqueue_style( 'theme-style', get_stylesheet_uri(), array(), null, 'all', 99 );
// Load main JavaScript file
wp_enqueue_script( ‘afterdark-navigation’ , get_template_directory_uri() . ‘/main.js’ );
}
// Hook to the scripts and style enqueueing
add_action( ‘wp_enqueue_scripts’, ‘ad_add_styles_and_scripts’, 99 );
- This topic was modified 56 minutes ago by . Reason: Add missing line breaks
