I’m using PRO. What is the best way to make an entire ‘promo element’ a link?
Jeff
Hi Jeff,
First, you have to set the ID for your promo element:
After that add the following code under Customizer > Custom > Global Javascript
:
jQuery('#promo1 .x-promo-image-wrap img').wrap('<a href="http://www.example.com/" />');
Hope it helps
Perfect. Thank you!
You’re welcome!
Thanks for letting us know that it has worked for you.
This is really an awkward way of doing this. I’ve had several clients request that the images be clickable. People expect that and it ought to be a built-in option.
That said, I found a different way of making a Promo into a link — wrap the shortcode in an a tag. I’d show a code example here but there doesn’t seem to be a way of inserting code.
I’m not sure if wrapping the shortcode in an a tag produces valid HTML but it seems more straightforward than adding Javascript elsewhere in the UI.
Hello There,
Thanks for updating this thread. The JS code will work out if you are using the promo element within Cornerstone. The shortcode version with a link tag will work out too. You just have to insert the promo shortcode inside a text element manually. The code is still correct and have a valid html result. It goes like this:
<a href="http://google.com">[promo image="http://yourdomain.com/image.jpg" alt="Example"] Your content here. [/promo]</a>
Hope this helps. Kindly let us know.