Skip Navigation

custom field as link for a view

This support ticket is created Il y a 8 années et 1 mois. 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.

This topic contains 2 réponses, has 2 voix.

Last updated by emilyr Il y a 8 années et 1 mois.

Assigned support staff: Luo Yang.

Auteur
Publications
#239899

hi–

i have a made a CPT that i am using only to make a view. in that CPT is a title, featured image and a custom field with a URL to an external site.

in my view, i would like the featured image to be a link to that URL in my custom field. i have searched the forums and tried everything i can think of, yet no dice.

site is here: hidden link

the two images at the top of the right column are what i would like to be links.

also, i have created the CPT and custom fields in Types.

many thanks,
emily

#240220

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi emily,

Please try like this:

<a href="[types field="my-custom-field" output="raw"][/types]">[wpv-post-featured-image]</a>

You will replace my-custom-field with your custom URL field slug

More help:
output:
'raw' | 'html' | 'normal'(default)
‘raw’=display raw data stored in DB, ‘html’=wrap data in HTML
https://toolset.com/documentation/functions/#tf-145184

#240300

luoy, this worked *perfectly* thank you so much!