Adding links to Classic Feature Box image

Hi, I understand there have already been quite a lot of posts on this, but I've tried many suggestions and none are working. I have inserted some Classic Feature boxes, and I am using an image. I would like to make the image a hyperlink - there are four of these altogether.

I have tried the suggestion in this thread - https://theme.co/apex/forum/t/code-snippet-add-a-link-to-feature-boxes/273 - but it didn't work.

I thought that maybe the idea from this thread could work, if it can be adapted to include a feature box (not background) image? https://theme.co/apex/forum/t/how-to-put-link-on-the-background-image/19380 I haven't tried it as I don't know what to label the sections as?

Thank you very much.
Jess

Hi There,

The code from this article should work fine.
https://theme.co/apex/forum/t/code-snippet-add-a-link-to-feature-boxes/273
We are not sure exactly what is happening on your side, to help you on this please send us your website details so that we can see and give you a proper answer.

Please provide following information:
Set it as Secure Note
* Link to your site
* WordPress Admin username / password
All the best!

Thanks so much - I only have a very basic understanding of code, can you please tell me where exactly I insert the link, and where the code is going - in Cornerstone or the Wordpress customiser? I can copy the code easy enough across all four, but I just need an example of exactly what to include please. Thank you.

Hi There,

I would like to check your website but the login URL is forbidden right now:

Please double check.

Thank you.

Hi there, I sent a secure note with the login details. I will send another one.

Hi Brice,

Actually, what you have done so far is great! well done!

You had some syntax errors in the JS snippet that I've fixed for you now. So the classic feature box items are now linking to the designated links, however, if you want to make the image only to be clickable, you just need to change the selector from:

.feature-box-1

to:

.feature-box-1 img

so your first line of code should be:

$(".feature-box-1 img").wrap('<a href="http://selfhelpafrica.org/link-1/" />');

and do the same for other items.

Thanks.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.