Integration into your theme

If you want to integrate a SmoothGallery into your theme you can use the WordPress SmoothGallery plugin. There’re two ways to do this:

  1. You want a gallery in your sidebar? Use the widget.
  2. You want a gallery somewhere in your theme? Follow the developer howto.

Sidebar widget

Hint: The widget is pretty new. I’ll improve it soon…

The plugin comes with a widget that displays a gallery in your sidebar. This way it’s very easy to insert a gallery because you don’t need to know how to write PHP code. Since the widget renders the gallery inside an iFrame you can add as many galleries as you want.

There’re various options that you can change on the edit screen for every widget. The first thing you should do though is supplying the ID of a post or a page where you uploaded the images. Once you’ve done that the widget should work as expected displaying the images from the given post/page. If it doesn’t work check the value for imgsize: this has to match the values for the thumbnails under Settings – Media.

Developer Howto

All you have to do is to implement the function insertSmoothGallery in the file config.php; you can find it under wp-content/plugins/smoothgallery. Depending on your implementation the plugin makes sure that the CSS and JavaScript will be included inside your page; keep in mind that this won’t work if the SmoothGallery sits inside an iFrame.

Let’s say you want a timed gallery on the page with the id 4711 somewhere in your theme that’s 400×80 pixels. Open the file config.php and implement the insertSmoothGallery function like this:

function insertSmoothGallery() {
  # add all the conditional tags you're using to the array
  if (assert_functions_exist(array('is_page')) === false)
    return false;
 
  if (is_page('4711')) {
    return array('width'  => 400,
                 'height' => 80,
                 'timed'  => 'true');
  }
  return false;
}

Once you’ve done that put the HTML markup for the gallery somewhere inside your theme and you’re all set. No matter how you implement the function don’t remove the call to assert_functions_exist.

As you can see, I used the conditional tag is_page. These come in handy if you’d like to display the gallery on some specific pages only – if you don’t want that but a gallery on each and every page just remove the if statement and the corresponding curly brackets.

Just add another sidebar…

Instead of implementing the clumsy insertSmoothGallery function you can simply add another sidebar to your theme if you like that better. Think of it as a placeholder for widgets. It doesn’t necessarily have to be a vertical bar on the side – some horizontal thing in your header or footer is okay too.

So, maybe you want to have a look at the Widgets API and learn how to add another sidebar to your theme. Check out register_sidebar and dynamic_sidebar in particular; the page about the second function tells you how to manage Multiple Sidebars in your theme.

I wrote a post about adding a sidebar to your theme, just three easy steps that should be easy to follow if you’ve got a basic understanding of PHP and themes in WordPress.

Still not convinced? Maybe you’d like to read Ian Stewart’s We Need To Kill The Sidebar.

99 comments ↓

  • Danny says:
    Hi Christian, this is a sweet plugin, exept I cannot activate it as I get the
    “Plugin could not be activated because it triggered a fatal error.”
    Message.
    I’ve tried deactivting all my other plugins, and checked for the call to the header and footer, but no luck.
    Any ideas what the problem might be?
  • Hi Danny,
    please have a look at this comment.
  • Paul says:
    Great plugin but I can’t get it to work. What am I not doing?

    I’ve uploaded the plugin and activated it, but when i put

    function insertSmoothGallery() {
      return array('width' => 400,
                   'height' => 50,
                   'timed' => 'true');
    }

    in to my Main Index Template all that shows up on my page is the actual words and it doesn’t show the plugin.

  • Hi Paul,
    you’ll have to edit the file smoothgallery.php that comes with the plugin. Open it and search for the function insertSmoothGallery and insert your code there.
  • Paul says:
    Thanks for the quick reply but when I went in the smoothgallery.php file and changed the first function that says return false to the code above I still get the same problem.
  • This looks like a simple solution, but when I load my index page I get a big white blank where the image should be.

    You can see it here … http://www.bodycreativenetwork.com

    Any help would be greatly appreciated, thanks!

  • mas says:
    Ok I edited the smoothgallery.php already, plugin activated already and how to insert smoothgallery.php in my index.php?

    Do I have to put include smoothgallery.php? how do you do it?

  • Hi mas,

    how do you do it?

    This video shows you how I did it.
    Activate the plugin, implement insertSmoothGallery, insert the markup in your theme and you’re done. If it still doesn’t work read the FAQ or write me an e-mail.

  • Hello Christian,

    Thanks for providing us with this plug-in which we can use. I have a question though regarding integrating the plug-in within the site for the latest articles.

    On my home page, I currently have a tabbed feature where my latest article is displayed. What I would like to do is replace that with the SmoothGallery plug-in so that it would grab the three most recent articles and their related images.

    I was trying to use the code from your example on the front page, and wrapping that around the existing code in my theme which displays the latest article, but with no luck. Can you provide us with a way to integrate the plug-in in that fashion? Or at least point us in the right direction?

    Thanks. ๐Ÿ™‚

  • Hi everybody,

    Can you provide us with a way to integrate the plug-in in that fashion? Or at least point us in the right direction?

    This should be the feature you were looking for…

  • Justin says:
    When you say “put the code for the gallery somewhere on your page” which code is that? Thanks!
  • Hi Justin,

    When you say โ€œput the code for the gallery somewhere on your pageโ€ which code is that?

    That’s the HTML markup for the gallery. Thanks for the hint!

  • m says:
    What about using a gallery on one page only? I have mine on the front page but no where else. It works fine without error on this page. I used conditional wordpress tags in smoothgallery.php.

    All other pages give the error: invalid argument supplied for foreach() ….[file location] smoothgallery.php on line 94. This line is looking for key values but finds none since the gallery is only on the one page.

    What do I add to smoothgallery.php to avoid this little error?

  • m says:
    Answering my own question…

    in smoothgallery.php: make sure you double check your work when adding function insertSmoothGallery. Don’t change return false;.

  • Irene says:
    (implementing smooth gallery into theme)

    I tired to enter the code below into my wp-config.php file. Because of a statement below the code, according to the instructions as to how I understand it. I didn’t see a config.php file so I used the wp-config.php file. I also installed the smoothgallery files into my plugin directory.

    Now I just get this message when I get to my site.

    Parse error: syntax error, unexpected ‘}’ in /home/jaxel/public_html/sodafox/sodafoxblog/wp-config.php on line 28

    (code inserted)
    function insertSmoothGallery() {
    return array(‘width’ => 400,
    ‘height’ => 50,
    ‘timed’ = ‘true’);
    }

    (instructions)
    If you want to integrate a SmoothGallery into your theme you can use the WordPress SmoothGallery plugin. All you have to do is to implement the function insertSmoothGallery in the file config.php.

  • Hi Irene,
    have a look at the directory wp-content/plugins/smoothgallery: you’ll find a config.php there. Insert your code into this file.
  • Lizza says:
    Hi Christian,

    Thanks for this fab plug in! I’m just having trouble getting it to work. I amended the congif.php file in the smoothgallery folder:

    function insertSmoothGallery() {
      return array('width' => 550,
                   'height' => 250,
                   'timed' = 'true');
    }

    And then I inserted this code in my home.php file

    Corker Issue 2: Winter 2008 is out now
    Will Kevin Rudd deliver on all his election promises?
    <a href="http://tocome" title="open image" rel="nofollow"></a>
     
    Glam Punk
    We feature pieces from Aussie designers Trimapee and Robby Tjia
    <a href="http://tocome" title="open image" rel="nofollow"></a>
     
    Walking on thin ice
    One drug user and two nurses openly talk about their experiences with ice.
    <a href="http://tocome" title="open image" rel="nofollow"></a>
     
    Plastic Palace Alice
    Listen to our exclusive interview with this Aussie band
    <a href="http://tocome" title="open image" rel="nofollow"></a>

    And it is coming up with just words on the page. See http://corkermag.com/blog/

    What am I doing wrong?

    Thanks in advance.

  • Steve says:
    Ok, there is some serious misunderstanding on my part.

    I am trying to install the plugin on my home page and I get nothing.

    Here is what I did:

    1. uploaded & activated the plugin

    2. added this code to the config file (in the plugin directory):

    function insertSmoothGallery() {
      return array('width' => 380,
                   'height' => 250,
                   'timed' => 'true',
                   'showInfopane' => 'true',
                   'showArrows' => 'true',
                   'showCarousel' => 'true',
                   'embedLinks' => 'true');
    }

    3. placed this in my header file: insertSmoothGallery();

    4. in homepage file: insert_recent_images_box(5);

    5. created a test post with an image.

    Nothing displays on the home page. I want the carousel to display the images from the last 5 posts.

    What am I missing?

    Thanks.

  • Hi Steve,
    step three isn’t necessary. Have you used WordPress’ built-in Media Library to upload and attach the image to the post? Have you tried using the special tag inside the post? Does the latter work?
  • Zolud says:
    Hi, Christian. Is this version compatible with WP 2.0?
    And is there a “Gallery Set” function?
    Thanks a lot from Ukraine ๐Ÿ™‚
  • Hi Zolud,

    Is this version compatible with WP 2.0?

    I haven’t tested the plugin with WP 2.0 but just give it a try ๐Ÿ˜‰

    And is there a “Gallery Set” function?

    If you want images from some set in a gallery you have two options:

    1. attach images to a post/page, in the edit-post-screen scroll down to the bottom and copy the markup somewhere into the post; watch this.
    2. I’m working on an integration with Flickr – you’ll be able to create galleries based on set/favorites from Flickr.
    3. Since the second option currently doesn’t work and if you’re using WP 2.0 you won’t have the “Media Library” (do you?), so option one isn’t possible either. I suggest, that you update WP to 2.5 or wait until I’ve included support for images from Flickr.

  • RSimpson says:
    Hi Christian,

    I’m experiencing a bug in FireFox. The gallery loads, there’s a black flash on the screen, then the first image fades to white before the second loads without the fade transition.

    The page is the link I’ve set in the website field in this comment form. I’ve got the gallery loading as part of my theme so I haven’t included the smoothgallery custom field.

    Any ideas?

    Cheers,
    Robert

  • Hi Robert,
    hm strange, I can’t see the error here and I’ve tried it with Firefox (2.0.0.14) and Safari (3.1.1): the transition looks fine for me. I’m sorry, but I can’t help you with that.
    BTW: If you’ve integrated the gallery into your theme with the insertSmoothGallery function, you don’t need the custom field. So that should be okay.
  • Bong says:
    Hi!

    I was looking for a plugin that will show images in a nice way and I was glad I stumbled on your plugin. I want to integrate nextgen smooth gallery in the theme. I’m not a coder so I rely on cut-and-paste instructions.

    But I was stumped with the how to on integrating it with the theme.

    First, the plugin directory of the site I’m working on looks like this…

    mydomain.com/wp-content/plugins/nextgen-smooth-gallery/

    Do we have to rename the nextgen-smooth-gallery folder to smoothgallery?

    Inside the nextgen-smooth-gallery folder are the following:
    1. /smoothgallery ==> another folder
    2. nggsmooth.php
    3. nggsmoothframe.php
    4. nggsmoothsharedfunctions.php
    5. readme.txt

    Inside the /smoothgallery folder are the following:
    1. /CSS ==> another folder with images and CSS.
    2. /Scripts ==> a folder with JavaScript files only.
    3. License.txt

    My best bet for what passes as config.php is nggsmooth.php so I placed the function insertSmoothGallery there above all the other functions. My dashboard went blank. I also watched the videos.

    BTW, I have NextGen itself installed and running. Fact, the the images are showing great in the plugin settings page. If I can only make it appear on the front page… this is embarrassing but I’m also lost on the HTML mark-up to insert the gallery into the index.html or home.php.

    Thanks. ๐Ÿ™‚

  • Hi Bong,
    this plugin is just about SmoothGallery – if you’d like to integrate SmoothGallery with NextGen, you should ask these guys.
    However, if you decide to use this plugin I will of course help you to integrate it on your website; just write me an email.
  • Gregg says:
    Hi Christian,

    I am integrating this into my theme, but it displays the box with the arrow but no image. I am so close! I have checked the path to the image and it’s there. I am stumped. If you have any ideas I would really appreciate it.

    -Gregg

  • Amir says:
    Hey Christian

    Nice Plug-In you got going here. I’m trying to install it, but once I do all the steps you’ve put in the instructions I get no change visible. I’ve activated the plug-in, and pasted the markup text in the main index template so that it would show up after the header. I then went into the config.php, saw this

    function insertSmoothGallery() {
    	return false;
    }

    Which I then replaced with this

    function insertSmoothGallery() {
      return array('width' => 550,
                   'height' => 250,
                   'timed' => 'true');
    }
  • Vincent says:
    I am getting this error on ALL my pages and blog posts:

    Fatal error: Call to undefined function insertsmoothgallery() in wp-content\plugins\smoothgallery\smoothgallery.php on line 94

    I have added the code to config.php:

    function insertSmoothGallery() {
      return array('width' => 400,
                   'height' => 50,
                   'timed' => 'true');
    }

    The plugin seems to be breaking the wp_header() code on WordPress 2.6.1.

  • Salman says:
    Hey man thanks for the great plugin.

    im having some trouble with installation.. i did everything youve requested (im trying to include the plugin as part of my theme on the home page i.e. display featured posts) and you keep mentioning insert the HTML markup in the header.

    Could you please tell me WHAT html markup? im new to programming so i have no idea how to call the plugin on my home page?

    PS i think a lot of people are trying to use this to display their featured posts… maybe a tutorial just on that???

    thanks!

  • That’s a great plugin however I am having a bit of an issue. I installed it and played with the plugin enough to have it work (that’s what I thought!).

    The plugin displays the images and everything but I get an error message at the top and bottom of my page saying:

    Warning: Invalid argument supplied for foreach() in /home/.minni/xxxxxx/iphonedownloadblog.com/wp-content/plugins/smoothgallery/smoothgallery.php on line 97

    Line 97 is : foreach ($parameters as $key => $value) {

    I really don’t know what to do here.

    Any help would be greatly appreciated. Thanks

  • Hi Sebastien,
    if you changed the insertSmoothGallery function and it doesn’t return false or an array that holds the options for the gallery, the foreach statement will break apart.
    Just replace this function with the original one and everything should be okay. If you want to integrate the gallery into your theme and you want to change that function make sure to either return an array or false.
  • Thanks for the quick reply ๐Ÿ™‚
  • Craig says:
    I do web design & coding for a living and I have to say the instructions here are not the clearest I have ever seen. If I struggled to get this working, I can only imagine how many newbs get frustrated and go onto some other plugin.

    This is an excellent plugin and looks great, so here are the instructions to get it working:

    1. Open /wp-content/plugins/smoothgallery/config.php and at the bottom find this: function insertSmoothGallery() … and change it so that it looks like this:
      function insertSmoothGallery() {
        return array('width' => 600,
                     'height' => 200,
                     'timed' => 'true',
                     'delay' => '5000',
                     'showInfopane' => 'false',
                     'showArrows' => 'true',
                     'Carousel' => 'true',               
                     'embedLinks' => 'false');
      }

      Of course, you can change the settings to your needs and image size.

    2. Use Christian’s Markup generator or write your own code to insert on the page that you want to display the carousel. In my case, it was on the homepage and this is what it looks like: Sorry, but WordPress stipps out the HTML
    3. Upload the images to the spot that you designated in your code.
    4. Refresh your page.

    The reason I struggled to get it to work was that I had ShowCarousel, which was not correct and I happen to come across the correct variable (Carousel). Before I changed that variable I got zip, nada, nothing displaying although I could see that the code found the images ok. I even reverted config.php to its original state and my 5 images would display, stacked. I knew the problem had to be a setting in the plugin.

    Hope this helps the next person.

  • Kat says:
    I must be very stupid. I have attempted to add this plugin and get it to work. I believe I followed the directions: I have WP version 2.3.1. I uploaded the plugin to my plugins folder. I then activated it.

    Herein lies the problem. I do a test post. I add a couple of images and the plugin does not provide the code until I save. So I save and I follow all the directions in your video: I add the custom field and implement the shortcode. I’ve added the html generated code also and still, It won’t work. If there’s something else I need to do to the files, please tell me step by step because I’m not a programmer.
    But I get this error:

    Warning: Invalid argument supplied for foreach() in /home/content/e/f/o/efoliomn/html/wp-content/plugins/smoothgallery/utils.php on line 357

    I don’t know what to do. Please help.

  • Hi Kat,

    I must be very stupid.

    No you’re not ๐Ÿ˜‰ I’m sure that we’ll get this working!

    Can you e-mail me a link to your test post? I’ll have a look at your page to see what might be wrong.

    PS.: The error should be fixed in version 1.11.2.

  • Christiaan says:
    Once I add images to a post or page I just get “There aren’t any images attached here” where the code is meant to be.
  • Hi Christiaan,
    After adding the images you’ll have reload the edit screen. The SmoothGallery panel under Advanced Options won’t pick up the images until you hit reload in your browser or click Save. There’s no AJAX magic involved here.
  • andy says:
    I have a weird problem where the smoothgallery.php css returns a 404. If I remove the ‘prefix’ get parameter, it works ok.
    Any ideas?

    Just to clarify the statement above, itโ€™s the css link to the css code (smoothgallery.php) the plugin inserts in the head section of my html that I discovered was returning the 404.

  • Christiaan says:
    Can someone please explain exactly what the “HTML markup” is?
  • Hi Christiaan,
    the “HTML markup” is something like the following:

    <div id="myGallery">
      <div class="imageElement">
        <h3>Headline</h3>
        <p>Description</p>
        <a href="image.jpg" title="open image" class="open"></a>
        <img src="image_thumb.jpg" class="full" alt="Image Description" />
      </div>
      <!-- more imageElement div's here... -->
    </div>

    So it’s just the HTML describing the images for the SmoothGallery.

  • Christiaan says:
    Thanks Christian.
  • Matt says:
    This is now working for me. I activated the plugin, there is nothing now in the admin controls.

    I took the function code and posted it in my index.php file. There came an error saying it was already posted in the config.php.

    I want this to show up on the home page ONLY and not all the other pages. Please help…..

  • Hi Matt,
    just edit the file config.php in the plugin’s directory and the plugin will notice it; don’t copy the function to your theme. In case the howto above wasn’t that clear for you to grasp here’s what you should do:

    1. open the file config.php under wp-contents/plugins/smoothgallery
    2. edit the function insertSmoothGallery like so:
      # add all the conditional tags you're using to the array
      if (assert_functions_exist(array('is_home')) === false)
        return false;
       
      if (is_home()) {
        return array('width'  => 400,
                     'height' => 80,
                     'timed'  => 'true');
      }
      return false;
    3. adapt the returned array to your needs
    4. try playing around with the conditional tags if is_home isn’t working for you.
    5. insert the HTML markup somewhere into your theme and make sure that it just shows up where you want it – again use the conditional tags here.

    That should be it ๐Ÿ˜‰

  • Matt says:
    How would I make the pages/posts show up in the gallery?

    smoothgallery > On?

    Because that didn’t work with a post.

  • Along with the custom field you’ll have to add the shortcode too, like so: [smoothgallery].
  • Sarah LeBlanc says:
    Hi Christian,

    Thanks for the plug-in!

    I was able to get the smoothgallery up and running in my header, but when I insert the mark-up into the code for my header, I bump down the rest of the page 300 pixels (the same size as my smoothgallery).

    This is likely just an HTML problem, but perhaps others have encountered it as well. Could you please give me a hand?

    Thank you!

  • Hi Sarah,
    I’ve just changed the CSS value for element.style from display:block to display:inline and the page looks fine again – except for the gallery: it seems to hide behind the black box.
    I haven’t got the time and I’m sorry that I can’t have a detailed look at your theme but I hope that you’ll figure out how to display the gallery above the black box; try adjusting the z-index for the myGallery CSS element or change the background color to transparent, some of this might work.
  • Allan says:
    I want to put the gallery in my homepage.. how i can do this? because i only saw here the widgets and pages.. how can i insert it to the homepage only? thanks
  • Matt wanted to do the same thing. Check out my suggestion here.
  • Hi, I get the following error in my widget….

    Warning: Invalid argument supplied for foreach() in /home/tracyhar/public_html/wp-content/plugins/smoothgallery/utils.php on line 169

    Warning: Invalid argument supplied for foreach() in /home/tracyhar/public_html/wp-content/plugins/smoothgallery/utils.php on line 169

    Didn’t see this in the FAQ… hope you can help.
    Thanks, tracy

  • Hi Tracy,
    can you tell me what exactly you did to produce this error?

    You placed the widget in a sidebar, inserted the id of the post/page with the appropriate images on the edit screen of the widget, adjusted the value for imgsize and checked that WordPress generated thumbnails in that size? What else did you probably do?

    Sorry that there’s not much documentation for this right now, but I’m really looking forward to improve this.

  • I am trying to figure out the widget as well….

    is there a particular place the widget needs to be? I tried using the ID for my current front page. It doesn’t work though.

    any more research on these widgets?

    Thanks!

  • Hi David,

    is there a particular place the widget needs to be?

    Any sidebar with enough space for the images will work.

    I tried using the ID for my current front page. It doesnโ€™t work though.

    The widget uses the images attached to a post/page with an ID that you can enter in the options of the widget. If there’re no images attached to the given post/page the widget might break apart with a short error message or just don’t display anything. So in your case make sure that you uploaded some images to your front page.

    any more research on these widgets?

    As soon as I find the time I’ll improve the documentation on this one.

  • amy says:
    Hi Christian,
    I’ve been trying to get the carousel to show with no luck.
    All the other options work – I’ve tried ‘showCarousel’ and ‘c’ as well – what am I missing?
    here’s what I’ve got…

    if (is_page('200')) {
      return array('width' => 600,
                   'height' => 600,
                   'Carousel' => 'true',
                   'timed' => 'true',
                   'delay' => '5000',
                   'showInfopane' => 'false',
                   'showArrows' => 'false', 
                   'embedLinks' => 'false');
    }
    return false;

    Thanks
    a

  • turketay says:
    Hi, first sorry my english is a little weak:) ..
    I “zoxengen” I’m using the theme, but a kind of theme in the show’s homepage spaces and I would be happy if you could not help ..
  • Hey Chris,

    I just upgraded the plugin and now the gallery isn’t working. It’s showing two static images on the main page. Is there a fix for this?

    Ha, nevermind, figured it out. The config.php got overwritten. Thanks!

  • Quatog says:
    Hello Christian,

    I really love your plugin. It makes it easy for me to create a slideshow for my current posts on wordpress. However I also like this theme – http://bustatheme.com/wordpress/coda-blue/. I’m having a hard time to make them work toegether. I thought iframe was the answer but it does not seem to work. Can you help me on this? Thanks.

  • Hi Quatog,
    have you already installed this theme on your site? Can I have a look at the not-so-well-working galleries? URL?
  • Lenny says:
    Hey Christian,
    I have spent 3 hours trying all the different methods to get this plugin to work. I want it to show up only on my homepage. Can you check the site and help me?
  • Tricia says:
    Hi Christian,

    I found SmoothGallery and was impressed – but was confused on the implementation. So I was very happy to find your plugin!

    I have followed the instructions to install to my main index template. I do see the outline where the gallery should be and I even see the left/right arrows. However, the images are not there. I am only seeing the black status bar like it is trying to find the images. When the plugin is turned off, I am able to see the images.

    I have a feeling I missed something really simple…what does it mean when you only see the black status bar?

    Thank you so much!

  • Hi Tricia,

    what does it mean when you only see the black status bar?

    Either the links to the images are broken or another incompatible framework (jQuery, PrototypeJS) might interfere with SmoothGallery.
    I’ll write you an email so we can figure this out.

  • JT says:
    Christian – I have the same problem as Tricia. This is a recent problem as the plugin was previously working fine. Could you email me any advice you came up with for her?
    Thanks – plugin is great. Really like it.
  • Hi JT,
    you’ve got PrototypeJS on your website which is incompatible with SmoothGallery. To work around this you’ll have to put SmoothGallery inside an iFrame. Have your read my advice on adding another sidebar? Do this, use the widget and you’re all set.
  • Peter says:
    Hi Christian,
    I am attempting to use the smoothgallery widget on a wordpress based site I am building.
    I am getting this error.

    Fatal error
    : Call to a member function register() on a non-object in
    /homepages/45/d204742291/…P/wp-includes/widgets.php
    on line
    427

    The website I am building is in the Website section of the form. I would appreciate it if you took a look!
    Thanks

  • Hi Peter,
    somebody else reported this problem and in the end it was some other plugin causing this error. Try deactivating all plugins, turn them on one after another and check what plugin causes this.
    In case you’re using WordPress 2.8 this might be a problem of my plugin. I’ll try to verify this as soon as I can.
  • Kristian says:
    Hi Christian,
    I’m having problems with the setup of the plugin. I want gallery to be shown on the homepage only, I followed your instruction, but it’s unclear where exactly shortcode [smoothgallery] must be inserted (not the custom field, because I did that like in your video). Please give me an example, where and how to insert the shortcode. Thanks!
    K
  • Hi Kristian,
    the shortcode goes into the content of your page. Say, you wrote some text for your home page and want to show a gallery there. Just place [smoothgallery] somewhere inside the text where the gallery should appear.
  • Forrest says:
    Hi. Thanks for the plugin. It looks rad, but I can’t seem to get it to work. I spent the last four hours on it to no avail.

    I disabled all plugins.
    edited the config.php file
    uploaded test images
    added HTML (This could be explained in detail or add a link)
    “Once youโ€™ve done that put the HTML markup for the gallery somewhere inside your theme”… What HTML?

    I tried the is_home conditional
    and the is_page() conditional

    The image will load with the captions, but then disappears as soon as it loads. The only thing that is visible are the captions (which transition correctly and have a link).

    Does anyone have any ideas?

  • Hi Forrest,

    What HTML?

    The markup for SmoothGallery: you can read more about that here under the second step.

    The only thing that is visible are the captions […]

    Maybe you’ve activated the carousel (showCarousel set to true) but forgot to add thumbnails to the markup? In case you’re using the plugin’s mechanism to generate the markup read how it generates the thumbs for you here.

  • Forrest says:
    Hi Christian,

    Thanks for the reply. I will double check the function to see if showCarousel is set to true.

  • julika says:
    Hi Christian,
    Thanks for the good job, I love SmoothGallery but something went wrong, obviously because of my fault.
    I have just transferred the page from /wordpress to the root dir and smooth gallery and actually the whole widget part just does not work, I can not change anything.
    Any idea please?
    Thanks,
    Juli
  • Hi Juli,
    can you point me to a URL with a (broken) SmoothGallery? Then I’ll have a look.

    A first guess is that you forgot to change the site’s URL after you moved the blog to the root folder. Have a look at “WordPress address” and “Blog address” under “Settings – General”, maybe you have to adjust these settings.

    BTW: have you read this?

  • Elliot Robert says:
    Hello Christian, I’m attempting to get this plugin working and I can’t get it to show up. I’ve got the the plugin installed, the following code on the page in the spot I want it.

    Item 1 Title
    Item 1 Description

    Item 2 Title
    Item 2 Description

    function startGallery() {
    var myGallery = new gallery($(‘myGallery’), {
    timed: true
    });
    }
    window.addEvent(‘domready’, startGallery);

    However, I don’t understand how the [smoothgallery] tag comes in to play. Am I supposed to place this within php brackets some where? Could you explain this in greater detail. Thanks for your time.

  • Hi Elliot,
    have you read the developer howto above? The plugin helps you to insert the JavaScript/CSS where ever you want and you don’t have to add this yourself.
    Do you know what a shortcode is? Since this is a pretty powerful feature of WordPress I recommend that you look it up. Basically, you put it somewhere into the content of a post/page and it generates the HTML markup for SmoothGallery.
  • George says:
    Hi Christian,
    thanks for great plugin! I am having problems with widget at http://pal-w.ic.cz/.
    It works well, but there are some white stripes on the right and bottom (Il looks like space for scrollers, but I do not want to scroll pictures…). I believe that i am not using iframe… Do you think that it may causes theme?
    Sorry for bothering, but I really don’t know how to replace it.
    Thanks in advance!
  • Hi George,
    I’ll add an option to the widget that lets you change the background color of the iFrame; yes, the widget uses the iFrame – for many reasons – too.
    In the meantime please open the file utils.php that comes with the plugin, go to line 313 and insert the following code:

    $parameters['iframebgcolor'] = '#000';

    Adjust the color code to suit your needs.

  • George says:
    Hi Christian,
    thanks a lot, now itโ€™s much better. But still, stripes are here (only in black color), I hoped for some solution to remove them entirely… Anyway – thanks!!!
  • George says:
    Christian,
    I’ve found your advices to Debbie, so I have managed to “hide” scrollbars, but I have the same problem as the Debbie: the links are displayed inside iframe. So i followed your instructions and changed jd.gallery.js (using: target: ‘_blank’). But it didn’t help. I have checked the lines hundred times, I mean everything is correct, but the problem uis still here – I can’t open it in new window…
  • Jason says:
    @GEORGE:
    Christian’s code worked fine for you from what I can tell. It changed the stripes on the side/bottom to ‘black’ — this is because the ‘#000’ in the code equals ‘black’ ‘#fff’ would be ‘white’, and ‘#777’ would be grey.

    Please use this hex code reference chart to help you insert the proper code. It usually takes 6 digits, not 3.

    http://www.2createawebsite.com/build/hex-colors.html

    @CHRISTIAN: Thanks so much the amazing work, I really appreciate you taking the time to answer questions about the widget. I was having the stripe problem as well, and this thread helped so much. It’s already made a lot of people happy. Rock on.

  • Hi Jason,
    all I can say is: thank you so much!
  • Heinz says:
    Hi Christian,

    First: thank you for this great plugin.

    Second: I need it for creating an animated slideshow in my theme. Now after activation of this plugin, when I want to create a new page or post, I do not get any of the visual editor icons in the empty post/page. When I deactivate smoothgallery, they are there again.

    Is this due to a memory problem?

    Did anyone experience the same phenomenon?

    Cheers,
    Heinz

  • Mike M says:
    Hi Christian – looks great so far, but tried to get the slideshow to auto-start by changing the option in utils.php to “true” as below:

    ‘timed’ => array(‘true’, ‘t’, ‘timed’),

    but it’s not working – or did I read that bit wrongly (probably…)?

    Thanks very much!

  • Hi Mike,
    please don’t make changes in the code but use the attributes in the shortcode or configure the widget to adapt the gallery to your needs. In case you’re using the shortcode add timed=true to it, if you’re using the widget enter true where it reads timed. This should do the trick.
  • Mike M says:
    Thanks Christian – I’ve added [smoothgallery timed=true] by editing the html of the home page in the ‘edit page’ section of wordpress, but it’s still a static show. Is there something else I’m doing wrong?
  • Matt says:
    Thanks for the great plugin! I added it to my theme using your instructions with some difficulty, but after going back through it, I found where I messed up and it works great! THANKS!
  • Kova says:
    I’m so confused, all that nextgen and no nextgen, ..

    I was searching and searching, and I still can’t find it.

    Can you please help me, somebody ?! How to show smoothgallery in header (I know where to put call code, but I don’t know how to set it up with smooth gallery?!)

    I have nextgen gallery, ID of gallery is 1! How to take all photos from that gallery to show in header instead of my title ?!

    Please help. I will try to do it even if nobody gives answer, but it would be very nice that somebody helps. Thanks.

  • Hi Kova,
    this plugin has got nothing to do with NextGen Gallery. These guys might help you setting up a SmoothGallery with NextGen though.
  • angel says:
    in http://smoothgallery.jondesign.net/showcase/sliding-transition/ is possible to do sliding effect, it is possible to do that in smooth for wp?

    help me

  • Hi angel,
    sure, just supply the corresponding parameter – defaultTransition in this case with the desired value either in the custom field or as an attribute in the shortcode. Since you’ve posted your comment on this particular page I’d like to add that this isn’t possible using the widget at the moment; using insertSmoothGallery makes it possible though.
  • Eider says:
    Hi Christian!
    Is it possible to use html tags on the description field? I’m trying to cusomize font sizes and put some”<a>”, but it doesn’t seems to work. Thanks!
  • Hi Eider,
    I guess the JavaScript of SmoothGallery simply removes these tags. If you just want to change the font sizes the gallery comes with distinct IDs or classes usable by CSS selectors. Instead of changing the HTML, just adapt the CSS.
  • Eider says:
    Thanks, Christian!

    Another question: If I try to use a “<a href>” the final url shows something like: http://www.mywordpress_site.com/category/post/URL_I_typed. I’m using absolute values… how can I fix that?

  • Hi there,
    am trying to get the sidebar widget to function properly which it does but I have a white bar right and bottom of the images.
    See http://www.blogtest.org.uk/affinity/ to take a look.

    Can you tell me why this is happening and how to fix it?

    Thanks,
    Karl

  • Hi Karl Craig-West,
    this helps preventing scroll bars in the iFrame. You can either use CSS – overflow: hidden, etc. – to fix this issue or simply use the iframebgcolor parameter and set it to the background color of the iFrame.
  • Thanks Christian.
    Ideally I’d like to hide the overflow but all overflow parameters are hidden in the CSS already.
    What am I missing?
    Thanks,
    Karl
  • Hi Karl,
    open the file config.php that comes with the plugin and change the value of the constant ADD_PIXELS_TO_IFRAME to 0. Then add the following code, e.g., to the style.css file of your theme.

    .widget_smoothgallery iframe {
      overflow: hidden;
    }

    I’ve just tried it with Firebug – this fixes your issue.

  • Thanks Christian,

    it does work and I’m very grateful for your help.
    Will tweet thanks along with a link to your website.

    Regards,
    Karl

  • Liyaqat says:
    Hi,

    I am trying to use the widget plugin. I added one image to the post (for testing purposes) and then tried to see if it displays.

    i am unsure what do I use as the id? the number like 1, 2, 3 etc
    What is the dir?

    Thanks

  • Hi Liyaqat,
    simply supply the ID of the post you uploaded the photo to in the widget’s configuration under ID. The parameter dir can be used to pull images from a certain directory on your webserver.