WordPress Image Gallery

Sat, Nov 22, 2008

Wordpress Plugins, Wordpress Themes

WordPress Image Gallery

Building WordPress image galleries is a rather painless process and allows you to display a set of photos/images to your users inside posts/pages related to an event or topic.

In case you are interested in seeing what the result looks like, you may want to look at the Kgaswane Nature Reserve post I wrote on the Rustenburg website I built for my town/city. It has a set of photos in a WordPress post in a gallery format. Beautiful, isn’t it? Yes, the nature reserve is beautiful as well!

What You Need

Before we get started, there are two WordPress plugins which you are going to need. Neither of them are specifically required but I recommend them since they integrate very well and will provide your users with a more pleasant browsing experience and also gives you the flexibility that you need.

The first plugin was developed by myself personally. I released it on the Tribulant Software website and it requires a license. It integrates the Lightbox JavaScript library into WordPress and gives you the ability to display images in an overlay on the same page.

The second plugin is a free, GPL based plugin which was developed by Peggy & Justin Hawkwood. The Gallery Plus plugin simply adds configuration values for the WordPress “gallery” shortcode in the “Settings” section of your WordPress dashboard.

Upload both of these plugins to your “wp-content/plugins/” folder after downloading and extracting them. With the plugins uploaded, go to your “Plugins” section in your WordPress dashboard and activate them. By activating these plugins, they are ready for use and you can configure them according to your needs in the “Settings” section of WordPress.

In order for the WordPress Lightbox plugin overlay effects to be used when you insert the WordPress gallery shortcode, you need to change a configuration value in the Gallery Plus plugin. Go to “Settings” > “Gallery Plus” in your WordPress dashboard and change the “rel value in <a> tag” setting to “lightbox”.

Building a WordPress Image Gallery

Before you can insert an image gallery into a WordPress post, page or theme, you’ll need to upload/attach some photos/images to a WordPress post or page. You can do this by writing a new post or editing an existent post and make use of the media uploader integrated into the WYSYWIG editor of WordPress to upload your images.

IMPORTANT : Replace the curly brackets in the codes below with block brackets. In other words, “{” becomes “[" and "}" becomes "]“. Otherwise it will not work.

With a few images uploaded to a post/page, you can insert the following code directly into the content of the post/page where you want the WordPress image gallery to appear.

{gallery}

This WordPress gallery shortcode will be replaced with thumbnails of all the images you uploaded to the specified post/page using the media uploader mentioned above.

If you prefer to insert an image gallery into a WordPress theme, you can do so by inserting code like below into your WordPress theme files.

<?php echo do_shortcode(‘{gallery}’)?>

There are several options you can specify when executing the WordPress gallery shortcode. For example, when hardcoding the image gallery directly into your WordPress theme, you’ll need to specify an “id” attribute to tell WordPress which post/page’s images you would like to show.

, , , , , , , , , , , , , , , ,
scriptlancebannerpng

This post was written by:

Antonie Potgieter - who has written 57 posts on Lost-In-Code.

I (Antonie Potgieter) am a software engineer/web developer located in South Africa. My full-time work is the management of Tribulant Software and the development of its software packages.

Contact the author

60 Comments For This Post

  1. data entry Says:

    I have used it. Many thanks.
    Can you give me any wordpress image gallery theme.
    I am waiting for your kind reply.

    Regards
    Muddasar Khan

  2. Jonh Says:

    Good information on your site for this story and your post looks very interesting. Keep up the good work.

  3. Online Admission Says:

    Good information useful for us and also valuable

  4. Blog Tips Says:

    Nice pics there. Have fun!

  5. accounting homework Says:

    Good one, galleries can be useful at times especially for projects etc

    Thanks for posting them :)

  6. web writing trainer Ben Says:

    Antonie

    Thanks for this.

    The Kgaswane Nature Reserve post pictures are really beautiful while the Rustenburg site has a lovely clean, professional feel to it. I’ve toyed with the idea of doing one for my home town here in Carshalton, England, but still haven’t got round to it. Your site has inspired me to take some action.

    Now all I’ve got to do is find the time!

    Ben

  7. Medisoft Software Says:

    This post is full of great information. Thanks for the post.

  8. Antonie Potgieter Says:

    Hi Ben,

    Thank you for the kind words. I wish you all the best of luck with starting a business directory for your home town.

    All the best,
    Antonie

  9. web writing trainer Ben Says:

    Hi Antonie

    You’re welcome and thanks for your good wishes. If I get the project off the ground, I’ll let you have a link.

    Take care.

    Ben

  10. Buzz News Says:

    Great article. I’m hoping to start a new blog. And I wanted to add an image gallery to it. This information is very useful. Thanks for sharing.

  11. video Says:

    Thanks, I enjoyed your post immensely. It’s nice to see someone writing something worth reading

  12. Lovelinks Says:

    I was looking for a way to setup a pic gallery, This helps a lot. Thanks for sharing the information.

  13. EPICENTER Says:

    Great Info!
    Thank you, for your posting, Gallery Plus was the script Im searching for!
    Greetings Martin

  14. Dr. Uy Santiago Says:

    I run several WP-blogs. Most of them are in german. The german blogging communitz is a kind of strange so I try to avoid them.

    I am glad to find sites like this and have in general the feeling that the WP-Community in english is much more helpful than the german one and of course offers a bigger veriety in themes and plugins.

    Therefore I am happy to spend some hours to adjust the themes and plugins (most of them are ok) to german.

    to all out there who are sharing their knowlegde and Ideas.. Thank you a lot

  15. Tents Says:

    That’s certainly a great post. Galleries are really good components for your blog. Thanks for the information. Certainly would be very useful. Cheers

  16. Tents Says:

    My friend who commented earlier recommended this post to me. I was looking for a way to add an image gallery to my site. This really helped me out. Thanks for sharing.

  17. Suggest Great Websites Says:

    Galleries have many uses. Thanks for sharing some of these pointers.

  18. コピーブランド Says:

    Great! Woo!
    I agree with you!

    Thank you for sharing this with us.

  19. osc shop Says:

    Good information on your site for this story and your post looks very interesting. Keep up the good work.

  20. Insurance Says:

    I should say that I was really impressed with your “WordPress Gallery Plus Plugin”… It worked very well… The suggestion on how to use these plugins on wordpress was worth implementing.. Thanks for the lovely post…I have bookmarked your blog..

  21. poker Says:

    Great job that you do with “WordPress Lightbox Plugin” i see it in action by my frien designs. He told me about this page. Just want to say you: You plugin is awesome, even when im not a web desing, was easy to understand and make a lot of image galleryes.

    Thanks.

  22. car dvd Says:

    wow, nice, thank your so much for your sharing ~

  23. Midlands Workwear Says:

    I was looking for a way to implement a photo gallery in my site on work wear. This explained a lot to me. I’m glad that I came across your post. It was very informative. Learnt a lot from it. Thanks for sharing.

  24. Leeds Accountants Says:

    Nice article and a very interesting post.

    Galleries are a useful resource – especially during certain projects. Have fun !

  25. Bi Folding Doors Says:

    It is definitely a wonderful idea :) the picture can be stored in a page maybe with category too and if you just want to publish an image you are free to comment it directly from that page :P

  26. seymour @ want to grow taller Says:

    Thanks for the interesting post on WP image galleries. I look forward to reading more posts from you in the future.

  27. Walery Says:

    It’s very useful plug in for WordPress, and I often use it in my blogs

  28. Learning online Says:

    If you put the pics on Flickr then one solution might be Pictobrowser. It makes a nice gallery that you can embed in a page or blog posting. It will grab pics, that you specify, from your Flickr account. I have used it in WordPress though the linked page seems to offer a link to another site that suggests some small config (a plugin) might be necessary to get it work to work with WordPress (config that I don’t remember having to do to get it to work for me).

  29. bisnis internet Says:

    Thanks for the tips, i want to build photo gallery for blog wordpress posting. thanks.

  30. affordable websites Says:

    Can this be implements with HTML:TAGS? this plugin is really cool but i cant seem to get it working. can anyone help?

  31. Bird Roc real estate Says:

    Looks wonderful, and with it setting up a Gallery Category so that all pictures which are in the post, are also accessible there? Right? I got the upload scenario which is great but the Image Gallery is also very good.

  32. oktay Says:

    Thanks for the interesting post on WP image galleries. I look forward to reading more posts from you in the future.

  33. Medical Job Australia Says:

    This is a really good feature and I love this effect, Thanks for the useful tut.

  34. concrete garages Says:

    The problem with finding an “ultimate” WP photo gallery is that there are so many different conceptual frameworks for presenting and administering this kind of thing; you and any given programmer may have different ideas about what’s best. And even the best of them probably won’t be as slick as Flickr, simply because of the resources available. There are some that act as blog-integrators for Flickr (or other photo-hosting services), like Slickr, which indeed looks pretty slick.

  35. Frank P Says:

    Thanks for this, been exploring various gallery options and this had a lot of the features I was looking for – one question, in your example you have a “next” link in the fotter of the image in the lightbox.
    In my implementation the next/previous are only shown on rolling over the image. Is there a way to implement this gallery the way you have it?
    Thanks!

  36. Reader from google Says:

    What a nice article! I am confused now. Nice work!

  37. concrete garages Says:

    This would avoid so much frustration for users if WP had an incorporated and uncomplicated Gallery that allowed comments, that could simply be turned on or off during installation.

  38. Leeds Wedding Says:

    Do the images have to be of the same size in terms of width and height, can you use images of different sizes within a frame to make the gallery have less of a blocky feel?

  39. David Hood Says:

    We are moving to a WordPress blog, I’m going to need as much good info as I can get.

  40. Bowling Tips Says:

    Really awesome. i was looking to add a image gallery in one of my WordPress blogs. This article is just what I wanted. Thanks for the article. Cheers

  41. David Hood Says:

    WordPress gallery is great thanks for sharing this info on the plugins.

  42. Wedding Videos Says:

    Thanks for the good post.

  43. free payroll software Says:

    Can this be implemented in other ways like tags? This seems to be a really cool plugin and I can’t wait to implement it.

  44. Application Performance Management Software Says:

    I am a big fan of NextGen Gallery. I feel it can do anything and everything I and my clients need.

  45. Smile Says:

    Looks good, I was looking for an easy image gallery option in wordpress, instead I ended up using an external one till I found this.

  46. Catalin Says:

    This plugin works very well but i don’t know how to configure it to change the borders width. Thank you for suggestion !

  47. Ashley Says:

    I have used the Lightbox gallery and it was quite good to make the gallery more live and visually appealing.

  48. Printers Liverpool Says:

    That’s really neat. The gallery is now one important component of a site with all the photography around nowadays. Thanks. Cheers

  49. Minty Themes Says:

    I’ve experimented with this gallery a bit, but not too much. It’s pretty awesome and works very well for a portfolio type blog.

  50. Paul Smith Clothing Says:

    Great plug-in. I needed to implement a gallery for my club and I was looking all around with various methods even using picasa and flickr. But I guess this is the best way. Thanks.

  51. sports supplements Says:

    This is fantastic, i’m just starting up with my blog and I’ve just learnt so much from this! thank you so much for sharing this! brilliant stuff! cheers

  52. Lyle and Scott Says:

    Love the plug-in. Just tried it out and installation was such a breeze. Anyone can do it. Thanks.

  53. consultant seo Says:

    well,What you need to do is add a text widget to your sidebar and insert the HTML code that displays the image that you want. There’s an excellent article on this blog which tells you how to insert a sidebar image

  54. Skid Steers for Sale Says:

    That’s a really neat idea. I surely would love to try it out while upgrading my blog. Has it got any newer version I could use? I know newer is now always better but I would like to try the newest ones :)

  55. photorelive Says:

    thanks for the tips

  56. Gene De Lisa Says:

    [] are brackets.
    {} are braces.

  57. Berg Says:

    Thanks for the share. Love the pics and obviously a useful tool.

  58. mobi Says:

    Very interesting this plugin , it’s simple to use and pratic
    good !
    thanks :)

  59. Rafe Says:

    Hi

    I’ve just purchased your gallery and installed, but I get the message “The plugin does not have a valid header.” and then it doesn’t install … Can you help?

  60. grillsandgate Says:

    Thanks for sharing… super stuff!

1 Trackbacks For This Post

  1. Wordpress UK » WordPress Image Gallery Says:

    [...] WordPress Image Gallery This entry was posted on Saturday, November 22nd, 2008 and is filed under WordPress Plugins. You [...]

Leave a Reply