WordPress.org

Support

Support » Plugins and Hacks » WP Easy Columns » [Resolved] CSS file reference causing issues on SSL (https) sites

[Resolved] 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://” instead of of being “protocol agnostic” is throwing an error on my SSL-enabled pages.

    Here’s from the source of an “https://” page of mine:

    <link rel=”stylesheet” href=”http://MySite.com/wp-content/plugins/easy-columns/css/easy-columns.css” 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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Pat Friedl

    @kcfried

    Phil,
    I’ll definintely see about adding a check for the column shortcode before including it.

    Awesome Pat. Thanks!

    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/

    Works fine without SSL but with it does not render the columns properly.

    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__) );

    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 ‘[Resolved] CSS file reference causing issues on SSL (https) sites’ is closed to new replies.
Skip to toolbar