Skip Navigation

[Resolved] Want to make the view loop output clickable

This support ticket is created 4 years, 10 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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by RensV5812 4 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1441175
div hyperlink.png

Hi support team,

I've designed a view that queries a custom post type and I have done some CSS styling to make the results more interactive. Now what I would really love is for these results to be clickable and link to the post. So instead of just the post title in the loop you can click anywhere in the loop item. I have linked a screencap of the page or see it in action here: hidden link

Is there an easy way of doing this? Is it possible to wrap the loop item in

<a> ... </a>

tags?

Thanks,
Rens

#1441701

Hello,

I suggest you try these:
1) Edit the the post view you mentioned in the screenshot:
https://toolset.com/wp-content/uploads/2020/01/1441175-div_hyperlink.png

2) In section "View loop", add a content template block,

3) In the content template block, wrap all contents into HTML a tag.

#1444195

Thanks Luo, I will try that and let you know.

Rens

#1445453

And there is a simple workaround:
You can add two HTML blocks, setup the HTML links, for example:

<a href="[wpv-post-url]">
</a>

Use them to wrap other blocks/contents, see screenshot:
https://toolset.com/wp-content/uploads/2020/01/1443831-link1.jpg

#1448363

Thanks you, I will try it tonight and let you know! 😉

Rens

#1448387

OK, please update here if you need more assistance for it.

#1557095

For anyone interested, it's been a while but I got this to work.

Placing the <a> tag around the other blocks/contents did not work. The closing tag was always moved to right after the opening tag.

How did I do it then? I found this video on YouTube: hidden link

I added the Jquery code inside the actual view loop block (inside a custom HTML block, enclosed in <script> ---Jquery here--- </script>.

<script>
jQuery(".CSSCLASS").click(function() {
    window.location = "[wpv-post-url]";
});
</script>