WP Easy Columns
[resolved] CSS file reference causing issues on SSL (https) sites (6 posts)

  1. Phil Derksen
    Posted 1 year ago #

    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?



  2. Pat Friedl
    Plugin Author

    Posted 1 year ago #

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

  3. Phil Derksen
    Posted 1 year ago #

    Awesome Pat. Thanks!

  4. 10institute
    Posted 1 year ago #

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


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

  5. nexdog
    Posted 1 year ago #

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

  6. Phil Derksen
    Posted 1 year ago #

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


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Easy Columns
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic