WordPress SmoothGallery Plugin FAQ

There are a lot of questions regarding SmoothGallery, JavaScript in general and the corresponding plugin for WordPress. This FAQ collects the most frequently asked questions and answers I came up with.

The following sections may contain useful information about your issue. Keep in mind that you can always write a comment or contact me for professional help.

It doesn’t work. Help!

In case you think you’ve read all the information available but there’s no coming forth here are some things to try.

  • You’re using the shortcode without the iFrame feature. Have you made sure to add a custom field named smoothgallery? If not, create it so the JavaScript and CSS for SmoothGallery will be included into your site.
  • In case you’ve put the SmoothGallery inside an iFrame but it seems like changing the options has no effect at all. Don’t use the custom field – just delete it – and insert the things you’d like to adjust into the shortcode.
  • You’ve checked the source code of your page but the JavaScript or CSS for SmoothGallery don’t show up. Make sure your theme has got calls to wp_head and wp_footer.

How do I change the appearance?

In case you want to change the appearance of the SmoothGallery you’ll have to adapt the CSS that comes with the plugin to suit your needs. You can find it in the plugin’s directory under wp-content/plugins/smoothgallery/css located in the file jd.gallery.css or jd.gallery.2.1beta1.css, depending on the version you’re using.

Theme integration

You’ve read the information about inserting a SmoothGallery into your theme but it doesn’t seem to work. Try this:

  • have a look at your site’s HTML source code. Is the JavaScript and CSS included? If not, make sure your theme has got calls to wp_head and wp_footer.
  • maybe you want to place a sidebar into your theme and use the widget that comes with the plugin. This post shows you how to do this.

There’s a SmoothGallery in my theme and …

… you want to change its behavior in some way? Since it’s very likely that your theme doesn’t use my plugin but just comes with a SmoothGallery you should first ask the theme’s author. If that’s not an option or he doesn’t respond to your questions, you may contact me for professional help.

I’m using NextGen and your howto doesn’t work!?

This plugin has got nothing to do with NextGen. Instead, it’s meant as a lightweight, standalone alternative that’s built upon the features already present in WordPress, like the media library, automatic image scaling on upload or the image editor. That said, this plugin doesn’t work with NextGen and there aren’t any special efforts to combine them in the future.
Please have a look at the SmoothGallery extension for NextGen and if you’ve got any questions regarding this plugin please ask the original authors because I may not be able to help you with their product.

Using the iFrame

Here are some issues regarding the iFrame feature that can be enabled using the shortcode and adding iframe=1 as an attribute. As soon as you’ve done this the SmoothGallery resides inside an iFrame which may cause problems regarding the appearance of the gallery and the functionality when it comes to zooming images or linking them to specific URLs.

Go the media library, select an image and click on edit. See the SmoothGallery link? Insert a destination URL there. This can be everything from an anchor tag to a fully featured URL.

Can I use ReMooz?

Unfortunately you can’t use ReMooz if the gallery sits inside an iFrame. Of course, you can do this but the result won’t be that appealing. If you need to zoom the images I recommend removing incompatible frameworks from the page you’re placing the SmoothGallery on and disabling the iFrame feature.

How I can remove the scroll bars?

In certain browsers the iFrame may show scrollbars which doesn’t look quite nice. If you would like to remove them you can either use CSS – overflow: hidden coming to mind – or change the value of the constant ADD_PIXELS_TO_IFRAME in the file config.php that comes with the plugin, a larger value might help.
Most likely you will have to set the background of the content in the iFrame to the surrounding color. This can either be done via the widget or the attribute iframebgcolor in the shortcode.

In case you’re using the iFrame feature and want to link your images to external websites you may have noticed that the link opens inside the iFrame – definitely not what you want. Opening the links in the current or a new window requires tweaking the JavaScript. Download one of the following files, unzip it and replace the one that comes with the plugin:

 SmoothGallery version
Target blankjd.gallery.js-blank.zipjd.gallery.2.1beta1.js-blank.zip
Target parentjd.gallery.js-parent.zipjd.gallery.2.1beta1.js-parent.zip

Note that once you’ve replaced the JavaScript files all links will open in the current or a new window; a future version may improve this issue.

No iFrame

If you don’t want to use an iFrame – whatever the reason might be – you’ll have to remove any JavaScript frameworks that are incompatible with SmoothGallery – like PrototypeJS or jQuery – from the particular page where the gallery sits. Most of the time this means tweaking your theme and there’s no one-fits-all answer for this.

You can try putting special if statements into your theme’s header – e.g. they may check the presence of the custom field smoothgallery – or you can opt for a new template file which can be assigned to the pages using a SmoothGallery.

Note, that you won’t be able to use the widget in this case because it resides in a sidebar only and relies on the iFrame feature. Although this may change in future versions of the plugin you won’t be able to use the widget without changing the plugin in this use case.