views:

37

answers:

2

Please take a look at this site as a reference: http://www.philsalesses.com/plasma-pong/

On the left you'll see a screenshot of an image. If you click the image, it will open colorbox for that one image.

I'm using wordpress, so associated with that post there are 4 more screenshots, all in a gallery.

What I want to do is when you click on that one image, to cycle through all the images in the gallery associated with that post.

I'm brand spanking new to wordpress, so please speak down to me.

+1  A: 

No need to speak down to - everyone starts somewhere. As for showing your other images, the way the colorbox plugin is setup on your page is like so (pseudocode):

for all links that contain an image {
    if the link is to an image {
        if the image has a CSS class of "colorbox-[0-9]+" {
            group it with all other images with the same CSS class
        }     
        if the image has a CSS class of "colorbox-manual" or no CSS class {
            don't group it with any other images
        }       
    }
}

Looking at your page I see two problems:

  1. Your one image link has the CSS class "colorbox-manual".
  2. There's only one link on your page that meets the above criteria :)

The easiest way to fix it would be to add the other 4 images to your post so they show up as thumbnails, however I suspect this isn't what you want. As a hack, what you could do is add the other 4 images and then give them all a display: none style. That way the colorbox plugin would find them and group them with you main image, but not actually show the thumbnails on the post.

Something like this for the four images:

<a href="image1.jpg" style="display: none;"><img src="image1-thumb.jpg" /></a>
<a href="image2.jpg" style="display: none;"><img src="image2-thumb.jpg" /></a>
<a href="image3.jpg" style="display: none;"><img src="image3-thumb.jpg" /></a>
<a href="image4.jpg" style="display: none;"><img src="image4-thumb.jpg" /></a>

If that doesn't work, check in your markup for the class that the colorbox plugin adds to your images. It should be in the form colorbox-[0-9]+ (i.e. colorbox-123).

Pat
This is the 95% solution. Now last question: When the display is set to none, there is still white space at the end of my article, 35 lines long since each link is there. I tried setting the image size to 0. Would setting the same x y position for each image and making them fixed work?
pinnacler
Yes, that would work. Something like `position: absolute; left: -5000px` would move them off the screen and not add any whitespace.
Pat
Thanks, that worked. Do you know if there is a way I can write a loop to pull every image in the gallery and add this code so I don't have to add them by hand?
pinnacler
But of course. This question should get you on the right track: http://stackoverflow.com/questions/1815158/show-attached-image-to-post-on-wordpress
Pat
A: 

I used NextGen Gallery, imported the pictures using that, set the "Effect" in the options to off. Then I went in to the nextgen source and added colorbox-1 as a class under each img. Style the CSS and I'm done. 4 hours tops.

Take a look at http://www.philsalesses.com/seaswarm for a demo.

pinnacler