Title: CSS file reference causing issues on SSL (https) sites
Last modified: August 21, 2016

---

# CSS file reference causing issues on SSL (https) sites

 *  Resolved [Phil Derksen](https://wordpress.org/support/users/pderksen/)
 * (@pderksen)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/)
 * First off great plugin! Nice and simple.
 * I’m on version 2.1.2, and there are 2 hopefully small fixes to the CSS file reference
   that would improve things.
 * 1) For SSL sites, the straight reference to “[http://&#8221](http://&#8221); 
   instead of of being “protocol agnostic” is throwing an error on my SSL-enabled
   pages.
 * Here’s from the source of an “[https://&#8221](https://&#8221); page of mine:
 * <link rel=”stylesheet” href=”[http://MySite.com/wp-content/plugins/easy-columns/css/easy-columns.css&#8221](http://MySite.com/wp-content/plugins/easy-columns/css/easy-columns.css&#8221);
   type=”text/css” media=”screen, projection” />
 * The fix is pretty easy. When you enqueue the css file you can use the plugins_url()
   function, like this:
 * wp_enqueue_style( ‘myPluginStylesheet’, plugins_url(‘stylesheet.css’, __FILE__));
 * 2) I am seeing the CSS file referenced on pages that aren’t using the columns
   shortcodes at all. Maybe you could do a check on the page before referencing 
   the CSS file?
 * Thanks!
 * [http://wordpress.org/plugins/easy-columns/](http://wordpress.org/plugins/easy-columns/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Pat Friedl](https://wordpress.org/support/users/kcfried/)
 * (@kcfried)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/#post-4320189)
 * Phil,
    I’ll definintely see about adding a check for the column shortcode before
   including it.
 *  Thread Starter [Phil Derksen](https://wordpress.org/support/users/pderksen/)
 * (@pderksen)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/#post-4320190)
 * Awesome Pat. Thanks!
 *  [10institute](https://wordpress.org/support/users/10institute/)
 * (@10institute)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/#post-4320222)
 * Hi – I am seeing the same issues. Where exactly (what file and what line) would
   I put:
 * wp_enqueue_style( ‘myPluginStylesheet’, plugins_url(‘stylesheet.css’, __FILE__));
 * [https://www.10institute.com/supplements/detox/](https://www.10institute.com/supplements/detox/)
 * Works fine without SSL but with it does not render the columns properly.
 *  [nexdog](https://wordpress.org/support/users/nexdog/)
 * (@nexdog)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/#post-4320233)
 * Hi, same question as 10institute above to fix ssl issues:
 * I did not find a reply to: Where exactly (what file and what line) would I put:
   wp_enqueue_style( ‘myPluginStylesheet’, plugins_url(‘stylesheet.css’, __FILE__));
 *  Thread Starter [Phil Derksen](https://wordpress.org/support/users/pderksen/)
 * (@pderksen)
 * [12 years ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/#post-4320239)
 * Hey Pat – Looks like this didn’t make it in the last update. Would you mind doing
   a search and replace and putting it in?
 * It would be pretty straight-forward. In the add_css() function, just remove this
   line:
 *     ```
       <link rel="stylesheet" href="<?php echo EZC_PLUGIN_URL; ?>/css/easy-columns.css" type="text/css" media="screen, projection" />
       ```
   
 * Then add this function:
 *     ```
       function enqueue_public_styles() {
       		wp_enqueue_style( 'wp-easy-columns-styles', plugins_url('css/easy-columns.css', __FILE__) );
       }
       ```
   
 * Then add this action to the to your main plugin function:
 *     ```
       add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_public_styles' ) );
       ```
   
 * Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘CSS file reference causing issues on SSL (https) sites’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/easy-columns_abb3b5.svg)
 * [WP Easy Columns](https://wordpress.org/plugins/easy-columns/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-columns/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-columns/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-columns/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-columns/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-columns/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)

 * 5 replies
 * 4 participants
 * Last reply from: [Phil Derksen](https://wordpress.org/support/users/pderksen/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/css-file-reference-causing-issues-on-ssl-https-sites/#post-4320239)
 * Status: resolved