Skip Navigation

[Resolved] Adding target="_blank" attribute to [wpv-post-excerpt] shortcode

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 1 reply, has 2 voices.

Last updated by Luo Yang 1 year, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#2582785

Tell us what you are trying to do?
When people click on the 'Read more >>' link in an excerpt I would like the link to open in a new browser tab.

Is there any documentation that you are following?
The wpv-post-excerpt] shortcode does not appear to support the option to add target="_blank" attribute.

I don't see any mention of being able to add this function here: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-excerpt

One idea I tried unsuccessfully was to add this js to that individual (organizations) archives page: https://toolset.com/forums/topic/how-to-set-target_blank-for-wpv-post-edit-link/

Is there a similar example that we can see?

What is the link to your site?
hidden link

My concern is after people do a search and view a record after clicking the 'read more' link in the excerpt, it is not intuitively apparent to the user if they hit their browser back button if it will take them to their previously created filtered page or back to the main /orgs/ directory. In fact it does take them to the filtered page, and since this is the case, how would I add a js '< Back' link e.g. with <p><< back</p> so that it appears only in the top of every page that one visited from a filter/search page?

Thanks for any guidance!

#2582845

Hello,

You can setup the 'more' attribute with HTML codes, for example:

[wpv-post-excerpt length='10' count='word' more='<a href="[wpv-post-url]" target="_blank"> Read more ... </a>']