Skip Navigation

[Resolved] Issue with slides not linking to external link

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

Problem:

The issue here is that the user wanted to add a link to each of their individual flexslider slides.

Solution:

This can be done by wrapping the image in an anchor tag.

<ul class="slides">
    [wpv-for-each field="wpcf-flex-slider-images"]
    <li>
      <a href="[types field='amazon-url' output='raw'][/types]" target='_blank'>
        [types class='' field='flex-slider-images'][/types]
      </a>
    </li>
    [/wpv-for-each]
  </ul>

This support ticket is created 6 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.

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 23 replies, has 2 voices.

Last updated by Charles 6 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1079705

Support,

This link has a slider with four images: hidden link

Slides 1 & 2 open a new tab when clicked and route properly to the external Amazon link.
Slides 3 & 4 open a new tab when clicked, but show the same blog post instead of the external link.

Not sure where the problem lies. All four slides should be opening a new tab when clicked and routing to the external link.

Another example: this link has three image. Images 1 & 2 route out when clicked, but image 3 shows the same post when clicked: hidden link

Thanks,
Charles

#1079719

Shane
Supporter

Languages: English (English )

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

Hi Charles,

Thank you for contacting our support forum.

Could you let me know how the amazon link was added to the images ?

Thanks,
Shane

#1079725

Shane,

If you edit each post and scroll down past the post body, you'll see a field to enter the Amazon links. Each post/item has it's own unique affiliate link.

Thanks,
Charles

#1081449

Shane,

Did my reply clear up how the link is assigned?

Thanks,
Charles

#1081494

Shane
Supporter

Languages: English (English )

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

Hi Charles,

I understand what the issue is clearly.

Would you mind if I took a local copy of your site ?

I tried this exact setup on my test site and the items all got the url.

Please let me know if I can install the duplicator plugin to create a local copy.

Thanks,
Shane

#1081496

Go right ahead.

Thanks,
Charles

#1083085

Shane
Supporter

Languages: English (English )

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

Hi Charles,

I have a workaround for you to try.

Add the anchor tag around the slides div making the entire slide have the same link.

Please try this and let me know if it helps.

Thanks,
Shane

#1087620

Shane,

This did not work for me and basically broke the code. Perhaps I did not add the code correctly in the in correct spot?

Assuming you wanted me to edit he Post Flexslider Template?

Thanks,
Charles

#1087671

Shane
Supporter

Languages: English (English )

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

Hi Charles,

This is how I meant for you to have it.

<a href="[types field='amazon-url' output='raw'][/types]" target='_blank'>
  <div class="flexslider">
  <ul class="slides">
 [wpv-for-each field="wpcf-flex-slider-images"]
    <li>
        [types class='' field='flex-slider-images'][/types]
    </li>
    [/wpv-for-each]
  </ul>
</div>
  </a>

Thanks,
Shane

#1087684

Shane,

Thanks for the quick reply.

The code you provided scrambles the slider. I'll explain:

If we look at this item (third item on left on home page): hidden link

All three pictures show in the slider if viewed from the home page, but once you click the product only 2/3 image appear in the slider.

Thanks,
Charles

#1087734

Shane
Supporter

Languages: English (English )

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

Hi Charles,

I believe the problem is mainly because of the first slider.

However i've edited the post content template at this link. hidden link

I've replaced the line below with the flexslider itself excluding the extra image that is not in the repeatable field group.

  <div>[wpv-post-body view_template="post-flexslider"]</div>

Thanks,
Shane

#1088456

Shane,

It's still not working correctly. When I click the post it admits the first image and only 2/3 show in the slider.

Thanks,
Charles

#1088612

Shane
Supporter

Languages: English (English )

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

Hi Charles,

Not sure what you mean but its working here for me.
hidden link

Thanks,
Shane

#1088623

That link you sent has four images total. Its only showing 3/4 images.

See the image here, that is missing from the slider in the post (fourth down on the left): hidden link

Thanks,
Charles

#1088624

Shane
Supporter

Languages: English (English )

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

Hi Charles,

Thats because it seems as if the static image is causing the issue itself.

   <li>
      <a href="[types field='amazon-url' output='raw'][/types]"  target='_blank'>
        [wpv-post-featured-image class='img-responsive' size='original' resize='proportional']
      </a>
    </li>

The featured image.

Thanks,
Shane