Skip Navigation

[Resolved] Can I add a link to types image shortcode?

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to make their images clickable that were being generated by Types shortcodes.

Solution:

To do this you can wrap your shortcode in an anchor tag like the example below.

<a href='someurl'>[types field='my-image'][/types]</a>
This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by himanshuS 2 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#2120303

I am using the Types shortcode to show an image of the user. I want the image to be clickable and direct the user to update the profile page. Currently, it does not seem like I can show the image AND add a URL to the page on the image.

Is there a way to do this?

This screenshot would help - hidden link

#2120365

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Himanshu,

You should be able to do this if you wrap the types shortcode in anchor tags like below.


<a href="posturl">[types field='my-field'][/types]

[/php]

You may need to use the WYSIWYG editor instead of the shortcode editor.

Thanks,
Shane

#2120395

Thanks, Shane. That worked just fine.

I have a follow-up.
Is it possible to add a placeholder/ backup image when the user has not uploaded an image in the types shortcode?
I want to show a grey image so that users share their information by clicking on the link. Right now, I have two separate images with conditions on them. It is not the most efficient way to do this.

Can it be done with one shortcode that adds a placeholder and shows the actual image if it is there?

hidden link

#2121133

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Himanshu,

The best way I can think of doing this is by using conditionals to check if the image field is empty.

Then load the placeholder image in its place if it is.

Example


[wpv-conditiona if="( '[types field='my-field'][/types]' eq '' )"]
Place Holder
[/wpv-conditional]

Thanks,
Shane

#2121863

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.