Wednesday, January 02, 2008

Wordpress and Gallery2

Over the Christmas break I found myself setting up a blog and associated picture album for my wife and me to use to share our travel experiences and pictures. I came across the excellent v-slider theme from Rui Pereira. It is a great theme that integrates smoothly with the equally excellent Gallery2. One of the big plusses is that Rui has created many option pages for the theme. One of them is the colour editor, you can change all the colours simply by clicking on a colour and using the colour wheel to change it; no messy fiddling with set-up scripts.

Changing the v-Slider theme colours

One or two things I came across when I was installing it that might be useful for others include:

Photo and WPG link appearing on the links line.
The Gallery2 embedding is done with the help of a Wordpress plugin called WPG2. This automatically creates a link to the gallery called WPG at the top of the page. The v-slider theme also creates a link to the gallery called Photos. The v-Slider link cannot be removed easily but the WPG one can be removed by going to manage pages in Wordpress and changing the status of the page to private or unpublished. It disappears from the link line. Don't delete the page otherwise the gallery linking no longer works.

More columns in Gallery
After setting everything up I found that gallery only had two columns for the thumbnails but I wanted three or four. First, I changed the column width in the v-slider2 theme in Gallery. I set it to 200 pixels (from 250, I think), saved it and found that I now had three columns.

Unfortunately, due to the fact that Gallery2 is embedded within wordpress, I found that larger pictures were getting chopped when I looked at them. I had also set v-Slider to be fluid width rather than fixed and the gallery was certainly too narrow now. I increased the size of the embedded Gallery to 900 and now have a wider Gallery and four columns of thumbnails. Very nice! To switch the Gallery width, go to WordPress admin and click on WPG2. Choose the "WPG2 Output" tab and change the width in the header, this is my finished one:
.g2_column {width: 900px;margin: 0px 1px 0px 12px;}
Save it and go back to the Gallery.