I was asked by a user about CaptionPix’s image link parameter – he wanted to know if there was any special order of parameters required for the image link to work. The answer to that is no. There is no special order. This post shows how to use it to link your image to a URL of your choice.
What If I Don’t Specify An Image Link?
If you don’t specify an image link parameter, your image will simply link to itself. That means if someone clicks your image, the image will display at its original size on a web page by itself. This isn’t a very attractive way to display the image and we will probably update the plugin at a later date to allow for lightbox view of the image, but for now it just links to itself.
How To Specify An Image Link
However, if you’d like the image to link to a specific URL you can do this by specifying the image link parameter.
For example, the image shown here on the left of a beach in the Bahamas, links through to the Wikipedia page for Harbour Island.
An example of how to do this would be as follows (but please don’t put a space before the word captionpix as I have below. I did that so that the code would fail to render an image so that you could see the code.
[captionpix imgsrc=”https://yoursite.com/your-image.jpg” captiontext=”Your caption” imglink=”https://www.bbc.co.uk/”]
In the above example, the image when clicked would link to the BBC website.
Marcus says
Hi, that’s great – and solves a head-scratch for me. Is there a way I could make the caption text link also though?
Looking forward to Pro version…
Liz says
That’s in the PRO version with a load of other settings. It’s a little bit tricky to add as when you add a link, the default styling from your theme will come into play … and that could look odd. So we’re adding code to style and link out the captiontext in Pro.
Jane Unsworth says
Hi Liz
I was wondering about including an affiliate link as per above … but not sure which bit goes where … from your example:
[ captionpix imgsrc=”http://yoursite.com/your-image.jpg” captiontext=”Your caption” imglink=”http://www.bbc.co.uk/”]
The affiliate link goes here …
“http://yoursite.com/your-image.jpg”
But not sure where the imglink bit comes in … and comes into it somewhere too?
I’ve tried every which way I can think of … 🙂 to the point I really wanted to conquer it but still just have a frame with the caption text sitting there … so just had to ask!
Many thanks.
Liz says
Get your affiliate link and put it where I have the http://www.bbc.co.uk/ link in the example.
You would put the image you want to show in the imgsrc parameter. So you need an mage and a link. You put them both in.
imglink means – the link you go to when you click the image.
imgsrc means – the image you want to show.
You can’t say just get some Amazon pasted affiliate code and paste it into CaptionPix. You have to deconstruct it and extract the part that is the image (and put that in the imgsrc parameter) and extract the part that is the affiliate link (and put that on the imglink parameter).
Neoglitch says
Liz, this is very interesting… but how come CaptionPix doesn’t have an option or parameter to add a link within the caption? That is, to do something like this (assuming this comment doesn’t turn the HTML to raw text):
This is the caption for this image. YAY! | Photo (c) ewaldmario
I’m currently using the “Links In Captions” plugin to do this, and I’m wondering if such a feature could be implemented in a future release of CaptionPix. Maybe by implementing something like:
[captionpix imgsrc="http://images/myfriend.jpg" captiontext="My Dog Rocco | {link url="http://www.flickr.com/photos/32299190@N06/5515035454"}Photo (c) someguy{/link}"]
Thanks for reading!
Liz says
We will do this – but in the meantime simply put the link into the captiontext parameter using HTML. The only thing you need to do is use single quotes around the href so that they don’t mess up the double quotes used in the captiontext itself.
So in your example becomes :
[ captionpix imgsrc=”http://images/myfriend.jpg” captiontext=”My Dog Rocco Photo (c) Someguy“]
Neoglitch says
Thank you Liz, I managed to make captionpix work the way I wanted. However, I ran into an issue:
I write the captionpix code in the HTML tab of the post editor, but if I switch back to the Visual tab WordPress automatically transforms all single quotes within each captiontext instance back to double quotes!
FROM captiontext=” <a href='http://www.thing.com… TO captiontext=" <a href="http://www.thing.com…
Thus, if I update and check out the post, all captions vanish! This means that every time I want to edit something in visual mode I have to go back to HTML mode, find each instance of captiontext and switch all double quotes within them back to single quotes. It's either that or never using the Visual tab again! xD
I don't know if there's a workaround for this issue, but I hope you guys address it on a future release.
This plugin has great potential. I will give you guys some suggestions for future releases later. Thank you!
Liz says
Personally I don’t use the visual editor – once you use code it isn’t wise to switch to the visual editor at all. The two are often incompatible. We will be making it easier for visual editor users to use, but that will be in a paid version of the plugin. Thanks for your suggestions.
Neoglitch says
Interesting… well, screw both editor tabs then! You just encouraged me to start using Notepad++ again! 😀
I’ll probably end up buying the premium version of CaptionPix, but I wonder:
Will we be able to create our own themes through some kind of interface, and format our captions as we wish?
Will we be able to add links more easily and also add non-breaking spaces within captions?
Liz says
Yes – all those things and more …. please watch this space and f you have any further requests for functionality tell us what they are.
Frieda says
Hi Liz,
I created my website using WP and it does not support html coding so I used a plugin for snippets. On the home page I want to wrap the the paragraph around the Tripadvisor image to the left and unable to do so with the theme i am using. So Does Captionpix support putting a snippet in theCaptionpix short code?
Thanks,
Frieda
Liz says
I have never heard of a WordPress site that does not support HTML. I also don’t know what you mean by “a plugin for snippets”.
It sounds like you would be better off getting your site set up properly without using plugins you don’t need. Once you do that, you’ll find that all of this is pretty easy and you won’t find it so confusing.