WordPress.org

Ready to get started?Download WordPress

Forums

SM Gallery
[resolved] Styling / Customizing (11 posts)

  1. mores
    Member
    Posted 1 year ago #

    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/

  2. Seth Carstens
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  3. mores
    Member
    Posted 1 year ago #

    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?

  4. Seth Carstens
    Member
    Plugin Author

    Posted 1 year ago #

    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

  5. mores
    Member
    Posted 1 year ago #

    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!

  6. Seth Carstens
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  7. mores
    Member
    Posted 1 year ago #

    Shall do.
    Still ... get the donate button done ;)

  8. Seth Carstens
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  9. mores
    Member
    Posted 1 year ago #

    Cool!
    Thanks, Seth.

    What's your paypal email?

  10. Seth Carstens
    Member
    Plugin Author

    Posted 1 year ago #

    You can donate from the official plugins page:
    http://sethmatics.com/extend/plugins/

  11. mores
    Member
    Posted 1 year ago #

    Code works as is. Great.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic