Support » Fixing WordPress » Use thumbnail to instigate Lightbox2 on main post image

  • I have this line on my category.php page to pull up the assigned thumbnails of my post:

    <div id="singleimg"><?php the_post_thumbnail('custom-thumbnail-size'); ?>

    What I’d like to do is allow the user to click on the thumbnail and for the main image in the post to open in Lightbox2. The post only contains an image, no text, as this is a a photography blog. The thumbnails are different sized and shaped images to the main post image so it’s not possible to use the main image as my thumbnail.

    Any clues?

Viewing 1 replies (of 1 total)
  • OK, I was being really thick. Well, perhaps I’m being a bit harsh on myself because I wasn’t aware that WP could do this: I uploaded the full image to the post but I selected the thumbnail (150×150) option. I saved the post and the output…

    <div id="singleimg"><?php the_content (); ?></div>

    …with lightbox2 running simply opens the full-sized image in lightbox! Voila, problem yok.

Viewing 1 replies (of 1 total)
  • The topic ‘Use thumbnail to instigate Lightbox2 on main post image’ is closed to new replies.