Forums

SimpleModal Login
Issues with overridding CSS from theme [BUG] (2 posts)

  1. transom
    Member
    Posted 11 months ago #

    First there is a bug - in your function login_css - it searches my template directory for simplemodal-login-{$style} but the following enqueue loads {$style}, rather than the right file name simplemodal-login-{style} (where $style should default.css or osx.css)

    In addition, the stylesheet name needs a slash in front of them as STYLESHEETPATH doesn't include a trailingslash (nor does get_stylesheet_directory_uri function)

    Second, I would recommend that you change the values of TEMPLATEPATH and get_template_directory_uri() to STYLESHEEETPATH and get_stylesheet_directory_uri() - to accomodate child themes.

    Otherwise great plugin and looks great in my project

    http://wordpress.org/extend/plugins/simplemodal-login/

  2. lukewarmmizer
    Member
    Posted 10 months ago #

    I'm not having that issue with the login_css() function on my site, it is correctly loading my custom theme (and also the included ones). The css and js files need to be in the plugin directory, not your theme/template

    Create a variable called $style that replaces %s with your theme name, so THEME.css
    $style = sprintf('%s.css', $this->options['theme']);

    Enqueue the style in your theme (because it is in double quotes, /css/THEME.css included, if it were single quotes it would be /css/$style)
    wp_enqueue_style('simplemodal-login', $this->pluginurl . "css/$style", false, $this->version, 'screen');

    I don't see any references to TEMPLATEPATH or get_template_directory_uri() :/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags