WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: SM Gallery] Styling / Customizing

[Resolved] [Plugin: SM Gallery] Styling / Customizing

  • I just got SM Gallery to work and I’m happy 🙂

    Now, since all of sm gallery’s stuff is being loaded in the footer, AFTER my stylesheet, anything I define will be overwritten since you use the !important tag quite a lot, too.

    How would I go about adjusting the width and height and visibility and position of the arrows? Should I edit the plugin’s stylesheet and re-edit when you bring out a new version or is there a better way?

    http://wordpress.org/extend/plugins/sm-gallery/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Seth Carstens

    @sethcarstens

    thats a very good point, I assume the styles you want to set are in this file: jquery.ad-gallery.css

    I think the best way to fix that issue would be to modify the plugin with a “filter” and allow the theme to filter the location of the CSS file. That way you could just create a filter from your themes functions.php file that calls a new stylesheet like this:

    add_filter(‘sm_gallery_css’, ‘my_themes_gallery_css’);
    function my_themes_gallery_css() {
    return get_stylesheet_directory_uri().’/my.jquery.ad-gallery.css’;
    }

    Then you would simply create the css file in your theme (or child theme) and edit the styles from there. Modifying plugin files isn’t an option for customization, or updating the plugin will simply erase all your modifications.

    Let me know your thoughts and we will try to program something tomorrow.

    add_filter('sm_gallery_css', 'my_themes_gallery_css');
    function my_themes_gallery_css() {
    return get_stylesheet_directory_uri().'/my.jquery.ad-gallery.css';
    }

    Will this work NOW or is this an addition you need to enable tomorrow?

    Plugin Author Seth Carstens

    @sethcarstens

    that does NOT work yet, but I think it will solve your problem. I’ll update you again tomorrow when there should be a new version of the plugin to download

    Super, thanks!

    BTW, while you’re firing up your editor you might want to add a way to donate to your plugin 🙂

    Because if your plugin lets me finish a job, you need to get a piece of the cake, mate!

    Plugin Author Seth Carstens

    @sethcarstens

    Not a problem. I would rather you donate by spreading the word. Tweet it, Facebook it, PIN it, and definitely rate it. Social sharing is much more valuable then a few bucks.

    Shall do.
    Still … get the donate button done 😉

    Plugin Author Seth Carstens

    @sethcarstens

    the update has been released. You should see it soon and you should be able to use the above function, or some modification of it, to load in your own stylesheet.

    Do note that it does not insert a stylesheet in a “normal” fashion. This is a javascript lazy loaded stylesheet (so that it only loads on pages that have a gallery… we are efficient like that). If you are searching your page source to check if the filter worked, look for javascript in the footer that references the gallery CSS file.

    Cool!
    Thanks, Seth.

    What’s your paypal email?

    Plugin Author Seth Carstens

    @sethcarstens

    You can donate from the official plugins page:

    Plugins

    Code works as is. Great.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] [Plugin: SM Gallery] Styling / Customizing’ is closed to new replies.