Skip Navigation

[Resolved] Adding Title attribute to a link in Views

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

Problem:

Add attributes to post title link.

Solution:

You can use shortcode [wpv-post-url] to output the post URL, and setup the link with HTML codes, for example:

https://toolset.com/forums/topic/adding-title-attribute-to-a-link-in-views/#post-1272175

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url

This support ticket is created 5 years, 5 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
- 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 4 replies, has 2 voices.

Last updated by John Cook 5 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1272147

I'd like to add this:

Title="[wpv-post-title] [types field='author-credit'][/types] [types field='author'][/types]"

To this dynamic link:

<h2>[wpv-post-link]</h2>

So that when a user hovers over the link they get the title popup.

How do I do that?

Thanks
---
John

#1272175

Dear John,

You can use shortcode [wpv-post-url] to output the post URL, and setup the link with HTML codes, for example:

<a href="[wpv-post-url]" title="[types field='author-credit'][/types] [types field='author'][/types]">[wpv-post-title]</a>

More help:
Outputs the URL to the current post.
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-url

#1272293

Thanks Luo that's working;

Can you tell me how to get the text BY AURTHUR MILLER along side the H2 Title THE CRUCIBLE but as it looks now NOT as an h2

URL: hidden link

CODE USING

<div class="row">
  <div class="col-sm-3"><a href="[wpv-post-url]" alt="[wpv-post-title] [types field='author-credit'][/types] [types field='author'][/types]" Title="[wpv-post-title] [types field='author-credit'][/types] [types field='author'][/types]">[wpv-post-featured-image size="medium"]</a></div>
  <div class="col-sm-9">
    <h2><a href="[wpv-post-url]" Title="[wpv-post-title] [types field='author-credit'][/types] [types field='author'][/types]">[wpv-post-title]</a></h2><span class="author-credit">[types field='author-credit'][/types] <strong>[types field='author'][/types]</strong></span>
    [wpv-conditional if="( '[types field='start-date' format='F'][/types]' eq '[types field='end-date' format='F'][/types]' )"][types field='start-date' format='jS'][/types] - [types field='end-date' format='jS F Y'][/types] at [types field='start-time-evenings'][/types][/wpv-conditional][wpv-conditional if="( '[types field='start-date' format='F'][/types]' ne '[types field='end-date' format='F'][/types]' )"][types field='start-date' format='jS F'][/types] - [types field='end-date' format='jS F Y'][/types] at [types field='start-time-evenings'][/types][/wpv-conditional][wpv-conditional if="( '[types field='start-time-matinee'][/types]' ne '' )"] (matinee at [types field='start-time-matinee'][/types])[/wpv-conditional]<br/><br/>
        <span class="strapline">[types field='strapline'][/types]</span>
    [wpv-post-body view_template="None"]</div>
</div>

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/how-to-get-the-text-by-aurthur-miller-along-side-the-h2-title/

#1272319

I assume the original question of this thread is resolved, for the new question, please check the new thread here:
https://toolset.com/forums/topic/how-to-get-the-text-by-aurthur-miller-along-side-the-h2-title/

#1272379

My issue is resolved now. Thank you!