SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2013
    0 Post(s)
    0 Thread(s)

    Conditional, clickable featured image

    Hello everyone

    I have a Wordpress site that has one featured image per post. Often, that image is exactly the same width as the maximum content width for a post, so it displays 1:1. Sometimes however, it's a much larger image.

    What I'd really like to achieve is this: when the source image is much larger than can be displayed, I'd like the user to be able to click the post image and have it popup (maybe in a lightbox?) the full resolution copy, which they can then click off when done.

    Can anyone help me with this?

  2. #2
    SitePoint Guru bronze trophy Slackr's Avatar
    Join Date
    Jan 2009
    New Zealand
    7 Post(s)
    0 Thread(s)
    Some themes do this automatically, that is any image link that is clickable can open in a lightbox rather than in a new page. Some lightbox plugins can also be added to a plainer theme without this feature and will add that lightbox function. It is a bit hard to give advice not knowing how your current theme operates, but yes you can add lightboxes into a theme and yes an oversized image can be displayed but you may need to monkey about with things to get it to work.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts