• Resolved mogeh

    (@mogeh)


    Hello and trust this meets you well!

    At the moment, in order to override the plugin CSS I will have to use the !important rule at every instance which will eventually leave me with a bloated file.

    I will appreciate your help with disabling the plugin CSS (style.min.css) or making the theme’s CSS easily override the plugin’s CSS.

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    Thanks for reaching out.

    Actually, our plugin CSS file loads after the theme’s CSS, and it’s essential for the correct layout and styling of the plugin. Disabling it would cause the plugin design and layout to break, so it’s not technically possible to disable the plugin CSS.

    This behavior is consistent with how most WordPress plugins work, as they include their own CSS to ensure a consistent appearance across different themes.

    If you’d like to override specific styles, you don’t necessarily need to use the !important rule everywhere — you can instead increase the CSS specificity of your selectors (for example, by targeting the plugin classes through your theme’s stylesheet). This approach should allow your custom styles to take precedence over the plugin’s defaults.

    Also, we assume that you are currently adding the CSS overrides in your theme stylesheet, which loads before our plugin CSS. We recommend adding your CSS overrides under the “Advanced CSS” or “Additional CSS” option in your theme’s Customizer panel. This will ensure your custom styles load after the plugin CSS and override it effectively.

    Thanks

    Thread Starter mogeh

    (@mogeh)

    Thanks for your response!

    Actually, our plugin CSS file loads after the theme’s CSS, and it’s essential for the correct layout and styling of the plugin. Disabling it would cause the plugin design and layout to break, so it’s not technically possible to disable the plugin CSS.

    The plugin CSS loading after the theme’s CSS doesn’t seem design friendly at all. Yes, the plugin styling is good but that’s not the styling i want for every aspects of the project.
    The plugin CSS is controlling all the styling including buttons, headings, line heights, margins, padding, etc. Having to override almost every styling of the plugin is counter productive for this project. Also i prefer doing my styling from a child theme instead of the customizer.

    My reasoning of blocking the plugin CSS file is so that after blocking the file, I can then copy the content and either add it to the theme’s CSS or enqueue it on a separate file.

    Technically, i believe it’s possible to dequeue the plugin stylesheet and re-enqueue it from the theme’s function.php, in this way i can have control over the design of the project.

    Thanks for your anticipated assistance.

    Thanks for sharing your detailed reasoning — we completely understand your concern.

    Yes, technically, it’s possible to dequeue the plugin stylesheet and then re-enqueue it from your theme’s functions.php file to have better control over the order and styling. However, please note that our plugin’s layout and functionality depend on that stylesheet, so if it’s dequeued, you’ll need to ensure all essential classes and layout rules remain intact to avoid design or alignment issues.

    Feel free to reach out if you have any questions or need any assistance.

    Thanks

    Thread Starter mogeh

    (@mogeh)

    For anyone who may have the need of disabling the plugin CSS, the code below does it.

    // Dequeue acadp css file
    function dequeue_dequeue_plugin_style(){
    wp_deregister_style( 'advanced-classifieds-and-directory-pro' );
    }
    add_action( 'wp_enqueue_scripts', 'dequeue_dequeue_plugin_style', 9999 );
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How to disable plugin CSS or make theme CSS priority higher’ is closed to new replies.