Working with galleries

Photo galleries and slide shows are and should be an integral part of telling the story of and showcasing the Texas Tech community. In The Hub Web site, we use a light box plug-in that works seamlessly (if not entirely automatically) with the native WordPress gallery to give us slide shows and nice light box functionality. There a couple tricks that have to be observed get pleasing end results.

Warning about captions

Gallery captions

Captions for gallery images are entered as Titles. (Click to enlarge.)

If you are going to use the WordPress gallery, you must NOT enter captions in the normal way for the photos you use. So when you add an image to the WordPress Media Library, you have to decide as you place it whether you want it to be a part of a gallery or a standalone. It cannot be both.

Images destined to be part of a gallery should go into the Media Library without a caption. However, the text that would be part of a caption, needs to be entered in the “Title” field. As a rule, you should keep such Title/Captions relatively short. This procedure takes care of half the caption issue. In order to get your WordPress gallery to be sweetly handled by the JQuery Light Box plugin and to make the gallery available as a slide show, you have to do one minor code tweak.

Now tweak the page code

As you build a gallery using the built-in WordPress gallery utility, WordPress enters some short code into your page. In editing mode, switch to the Text tab, and you will find short code looks like this (inside two braces) :

gallery ids="2225,2228,2223,2230,2234,2235,2236,2237,2238,2233,2232,2231"

Note: if you don’t see this code, you probably did not create your gallery using the WordPress built-in “Create Gallery” utility. Assuming you have the code, you need to insert this code (link=”file”) between the words “gallery” and “ids”.

Thus where your gallery appears on the page the code inside the braces should look like this:

gallery link="file" ids="2225,2228,2223,2230,2234,2235,2236,2237,2238,2233,2232,2231"

That’s all there is to it!

%d bloggers like this: