A photo gallery that can hyperlink each photo

4 replies
I am familiar with the gallery in Wordpress, and with NextGen Gallery. I need to hyperlink each photo in my gallery to a specific page on my Wordpress site. I don't believe I can do that with the above-mentiined galleries. Besides manually installing each photo one at a time with the <img src code, does anybody know of a photo gallery plugin to make this happen?

#gallery #hyperlink #photo
  • Profile picture of the author Kim Phoenix
    I should clarify this more....

    I need to know the HTML needed to align two images horizontally (with some space between them so that they are not touching one another). Each image needs to hyperlink to a separate page.

    This is what I've got so far:

    <a href="http://www.mydomainname.com/plr-packs/my-own"><img src="http://www.mydomainname.com/wp-content/uploads/2012/05/Product-1.jpg">
    <a href="http://www.mydomainname.com/plr-packs/the-best"><img src="http://www.mydomainname.com/wp-content/uploads/2012/05/Product-2.jpg">

    This HTML causes my images to be aligned VERTICALLY. What is the HTML I need to align 2 images horizontally on one line, and then 2 more images horizontally underneath on a different line? I don't need any text. I am also hyperlinking my images to a separate page (which you can tell by the code above). Thanks for any help!
    http://www.BuyHealthPLR.com (PLR Written & Edited by a Healthcare Professional)


    {{ DiscussionBoard.errors[6196282].message }}
  • Profile picture of the author Sillysoft
    You can float one next to the other, example:

    <div style="float:left;width:300px;margin-right:10px;"><img src="pathtoimage" alt="" /></div>
    <div style="margin-left:310px;"><img src="pathtoimage" alt="" /></div>

    Sloppy but you can work with that.
    {{ DiscussionBoard.errors[6207859].message }}
  • Profile picture of the author bsmith
    To get the formatting you want, just use "columns ="2"" if you want 2 columns -- or 2 images side-by-side.

    Use "columns="3"" if you want 3 columns -- or 3 images side-by-side.

    Shortcode examples:

    [gallery columns="2"]


    [gallery columns="3"]

    To give each image its own url, the following will work perfectly...you probably won't consider it a perfect solution but it does work perfectly....anyway, here's what you do:

    1. Create a gallery using WP's built-in gallery function and insert the shortcode using the "columns="x"" entry given above.

    2. Go to the gallery and copy each url the gallery creates to each individual image.

    3. For each url copied in step 2, insert the following line in .htaccess (and insert it ABOVE the WP entry in the .htaccess file or this probably won't work -- if there isn't a WP entry in your .htaccess file just insert these lines at the very TOP of .htaccess):

    Redirect 302 /path/to/image1 http://new-url.com

    Note: depending on how you copy url's, the "/path/to/image1" part will probably start out as "http://your-domain.com/path/to/image1" -- just make sure you remove the "http://your-domain.com" part of the copied url's.

    The "http://new-url.com" part is simply the url you want visitors redirected to.

    You will end up with a section in your .htaccess file that looks like this:

    Redirect 302 /path/to/image1 http://new-url
    Redirect 302 /path/to/image2 http://another-url
    Redirect 302 /path/to/image3 http://yet-another-url

    Note: the "http://" part must be included in the url you are redirecting to unless the url is on your present domain, in which case "/new/path/post" type entries would probably work....if they don't, just leave "http://your-domain.com" in (probably best to do it that way anyway).

    The "Redirect" part is self-explanatory I think and the "302" part is the http code for "temporary redirect" -- if you want these redirects to be permanent change "302' to "301".

    And that should do it.
    {{ DiscussionBoard.errors[6209174].message }}

Trending Topics