Skip Navigation

[Resolved] Add a custom title to the post featured image in a View

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

Problem: I would like to add a custom title attribute to the featured image displayed with the wpv-post-featured-image shortcode, but the title attribute isn't working.

Solution: The title attribute isn't supported on the wpv-post-featured-image shortcode, but you can create an image tag using custom HTML and apply the title and src attribute as needed.

<img src="[wpv-post-featured-image size='custom' height='150' width='150' output='url']" title="[types field='short-menu-title-2'][/types]" alt="[wpv-post-featured-image output='alt']" />

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153425

This support ticket is created 6 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by liatG 6 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1144278
Cables 101 Video PDF Screenshot Title Appears.png
No title appears for images in View on hover.png

I am trying to add a "title" attribute to the [wpv-post-featured-image] shortcode that I am using in a View.
I want a title to appear when the mouse hovers over the image, like standard behavior on most images.

Example page: hidden link - Scroll down to "Videos Included in This Course." See screenshot.

Here is the code I use in the View "Videos Included In this Course":

[wpv-post-featured-image title="[types field='short-menu-title-2'][/types]" size="custom" height="150"]<br /><br />
<b>[wpv-post-link]</b>

But no title appears.
I am trying to achieve the title appearing when user hovers over, as in Screenshot #2 ("Cables 101 Video PDF Screenshot Title Appears").

I don't want to have to upload all the images again to a Custom Field, just to be able to use the title attribute.

Is there any solution?
Thanks!
Liat

#1144513

Hi, the wpv-post-featured-image shortcode doesn't include the title attribute, but you can create your own image tag and insert the title attribute manually:

<img src="[wpv-post-featured-image size='custom' height='150' width='150' output='url']" title="[types field='short-menu-title-2'][/types]" alt="[wpv-post-featured-image output='alt']" />

https://toolset.com/documentation/user-guides/views-shortcodes/#vf-153425

#1146746

Thank you, this was just the solution I was looking for! Thank you Christian 🙂