Skip Navigation

[Resolved] Image Link Doesn’t Work From View

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

Problem:
Image link doesn't work in View, for Repeating image field.

Solution:
If you are using repeating image field, the correct shortcode would be like this [wpv-for-each]:

[wpv-for-each field="wpcf-image-field-slug"]
      <a href="[types field='image-field-slug' size='full' url='true'][/types]">[types field='image-field-slug' alt='%%ALT%%' title='%%TITLE%%' align='none' resize='proportional'][/types]</a>
      [/wpv-for-each]
This support ticket is created 7 years, 3 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

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

This topic contains 7 replies, has 2 voices.

Last updated by garyF-3 7 years, 3 months ago.

Assisted by: Noman.

Author
Posts
#556592

I am trying to: create a loop that displays images and also the link to the image e.g. you click on the image and it shows the image source

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[types field='images-for-gallery' width='64' height='80' align='none'][/types]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

Link to a page where the issue can be seen:
hidden link the top two images relate to this.

I expected to see:

When I click on an image it redirects to the source of the image

Instead, I got:

hidden link

The %20 keeps happening - I have recreated this on another site as well.

#556603

Noman
Supporter

Languages: English (English )

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

Hi Gary,

Thank you for contacting Toolset Support.

1. Please delete all sort of caches in your site plugin cache (WP Rocket), CDN cache (CloudFlare) server cache (if any), browser cache too.

2. Then use this updated code in View loop, I have checked and this one works at my end:

<wpv-loop>
<a href="[types field='images-for-gallery' output='raw'][/types]">
[types field='images-for-gallery' width='64' height='80' align='none'][/types]
</a>
</wpv-loop>
<!-- wpv-loop-end -->

I hope it will resolve the issue. Thank you

#556612

Hi,
First of all thank you for such a quick response and your help.

I have tried this on a local site running just toolset and the site I sent the link to and both have the issue. The space is till appearing. Local site is not cached and live site the caches and cloudflare have been cleared.

Gary

#556649

Noman
Supporter

Languages: English (English )

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

Hello Gary,

1. Are you using Repeating Image Field? Please provide screenshot where you have created image field.

2. Please try to create a new image field and then create a new View and use the updated code in View loop which I have sent you.

If problem still occurs, I would need to request for temporary WP and FTP login info for your staging site.

Thank you

#557636

Hi, the example where it doesn't work is here - hidden link

access to this will be available if you create a secure form for sending the details

#557644

Noman
Supporter

Languages: English (English )

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

I have enabled private message box, you can send us temporary WP-admin and FTP info for your site.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank you

#557804

Noman
Supporter

Languages: English (English )

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

I have updated the shortcodes in the View and now image links are working good:
hidden link

As you are using the Repeating Image Field, the correct shortcode would be like this one that I have added [wpv-for-each]:

[wpv-for-each field="wpcf-gallery-image"]
      <a href="[types field='gallery-image' size='full' url='true'][/types]">[types field='gallery-image' alt='%%ALT%%' title='%%TITLE%%' align='none' resize='proportional'][/types]</a>
      [/wpv-for-each]

I hope this resolves the issue. Thank you

#558512

Hi Norman, apologies for the delay in getting back to you on this. Thank you so much for helping me sort this out.