Skip Navigation

[Resolved] instead of taxonomy archive, link to search page

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

Problem:

in search results, when clicking on a taxonomy, instead of linking to the taxonomy archive page i want to link to the current search page, only filtered by the taxonomy.

Solution:

It needs a child taxonomy view, for example:

Create a taxonomy view:

- query terms of taxonomy "known-as",

- filter by:
Taxonomy is set by the current post

-In the view's loop, each term's link, like this:

https://toolset.com/forums/topic/instead-of-taxonomy-archive-link-to-search-page/#post-1152949

Relevant Documentation:

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

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1152634

hey,

in search results, when clicking on a taxonomy, instead of linking to the taxonomy archive page i want to link to the current search page, only filtered by the taxonomy. something like:

<a href="<em><u>hidden link</u></em> type='known-as' format='name']">[wpv-post-taxonomy type='known-as' format='name']</a>

The only problem is that sometimes there are more that 1 taxonomies under "known-as" (for example, it can be knows as a writer and a poet), and then it links to a broken link, because both taxonomies appear.
i tried using [for-each] shortcode, but it seems to work only custom fields.

is there anyway for a workaround this?

thanks!
ido

#1152919

Dear ido,

You can try the shortcode [wpv-post-taxonomy] attribute "separator", like this:

<a href="<em><u>hidden link</u></em> type="known-as" format="slug" separator='&wpv-known-as%5B%5D=']">[wpv-post-taxonomy type='known-as' format='name']</a>

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-taxonomy
separator (opt):
'string separator for multiple values'

#1152947

hey luo, thanks, but your solution doesn't separate the taxonomy. if i have 2 taxonomies (writer and poet) i want two seperate links - one for te writer, one for the poet. same as it works in custom fields.

#1152949

Thanks for the details, in your case it needs a child taxonomy view, for example:
Create a taxonomy view, query terms of taxonomy "known-as", filter by:
Taxonomy is set by the current post

In the view's loop, each term's link, like this:

<a href="<em><u>hidden link</u></em>">[wpv-taxonomy-title]</a>
#1152950

got it! thanks!

#1153371

You are welcome