I have installed a Wordpress plugin that is using !important on a max-width value that is breaking my layouts. I have tried various ways of overriding it, with my own CSS, however I am unable to use a high specificity of selector, as the plugin is already using it. I spoke to the development team about this, and they said it's because the plugin's stylesheet is loading before mine. Is there a way in which I can get mine to load first?
This is how I am enqueuing my stylesheets in the functions folder –
As you can see I have divided it up into the custom page template in the first section (if), and the main stylesheet in the second section (else).
Is there a way of making the main stylesheet take priority over those of the plugins I have installed?
if (is_page_template('page-templates/full-page.php')) {
wp_enqueue_style( 'mytheme', get_stylesheet_uri() );
wp_enqueue_style( 'mytheme-full-page', get_stylesheet_directory_uri() . '/css/full-page.css', array( 'mytheme_style' ) );
}
else { wp_enqueue_style( 'mytheme_style', get_stylesheet_uri() );
}
}
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles_and_scripts' );