Support » Plugin: Quotes Collection » [Plugin: Quotes Collection] [Bug fix] Plugin stylesheet overrides theme styles

  • Resolved jrf


    Hiya Srini,

    Love the plugin!

    While adjusting the css styles for the plugin output in my own theme, I found that not all styles are being picked up correctly.

    The reason for this is that the plugin stylesheet is loaded *after* the theme stylesheet therefore effectively overwritting the theme’s styling.

    This is bad practise and the advise in the faq to adjust the css in the plugin itself is too, as any changes made there would be overwritten by a plugin upgrade.

    Anyways, just thought I’d fix it. Please accept the below code-patch as a compliment to your plugin. I hope you’ll incorporate it into the next version.

    File: quotes-collection.php

    Find on line 376:

    function quotescollection_css_head()
    	<link rel="stylesheet" type="text/css" href="<?php echo plugins_url(); ?>/quotes-collection/quotes-collection.css" />
    add_action('wp_head', 'quotescollection_css_head' );

    replace this with:

    function quotescollection_css_head()
    	if ( !is_admin() ) {
    		wp_register_style( 'quotescollection-style', plugins_url('quotes-collection.css', __FILE__), false, 'v1.5.5.1' );
    		wp_enqueue_style( 'quotescollection-style' );
    add_action( 'wp_enqueue_scripts', 'quotescollection_css_head' );

    Hope this helps & keep up the good work!


Viewing 1 replies (of 1 total)
  • Plugin Author Srini G


    Hi Juliette, thanks for the feedback, and thanks for the patch, I have included this in 1.5.7.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Quotes Collection] [Bug fix] Plugin stylesheet overrides theme styles’ is closed to new replies.