Skip Navigation

[Resolved] Make custom field clickable in archive page

This support ticket is created 3 years, 8 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1712107
archive 1.PNG

Hi,

I am createing a archive page, in the archive page -> wordpress archive loop I insert a content template to display each post. How do I make some of the custom filed clickable? for example a single line custom field. when user click it, it can goes to the post.

#1712387

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

I noticed that in your content template for the Archive, you're using the "Fields and Text" blocks to show the custom fields, for example, the "cf-way-search" field.

If you'll switch to the HTML mode in that block's content editor, you'll see the field's shortcode like this:
( screenshot: hidden link )


<p>[types field='cf-way-search'][/types]</p>

You can include the link/anchor tag's HTML code around that field's shortcode like this:


<p><a href="[wpv-post-url]">[types field='cf-way-search'][/types]</a></p>

Please note how I've used the shortcode "wpv-post-url" to get the URL of the current post in the loop.
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-url )

regards,
Waqar

#1712609

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.