Skip Navigation

[Resolved] Create dynamic link to taxonomy archive page

This support ticket is created 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by mattS-15 2 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2518803

I'm trying to create a dynamic link to a taxonomy archive page.

In my site, I have a custom post type for races. They have a "month" and "state" taxonomy. As taxonomies they have archive pages. Each of these are only single selection taxonomies.

I want to create a link on each race post that would say: "See more races in [month]." where [month] is the correct month for the taxonomy and the link goes to that archive page.

I have just used inline fields to create the month text, but I cannot figure out how to create a link that would point to the appropriate archive page.

Here is an example race page - the links I'm trying to get to work are on the bottom: hidden link

And here is an archive page for the month: hidden link

#2519395

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you use the following shortcode [wpv-post-taxonomy] to display the taxonomy term you assigned to post and it will display the link of the taxonomy archive page;

See more races in [wpv-post-taxonomy type="month"  format="link" show="name"]
#2519399

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

What if you use the following shortcode [wpv-post-taxonomy] to display the taxonomy term you assigned to post and it will display the link of the taxonomy archive page;

See more races in [wpv-post-taxonomy type="month"  format="link" show="name"]
#2519791

Ok - excellent, this has worked. Thank you.

But this solution only applies the link to the single word representing the taxonomy. Any way to do this in a more abstracted way? e.g., apply the link to an entire string of text, an image, etc?

#2519823

Ok - here's where I landed based on your pointer. I am wrapping whatever target I have in HTML href and embedding the link using shortcode. So like this:

this is my target

Let me know if there are any other tricks - but think this one will work!!

#2520001

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - what you shared is the correct way.

#2520283

My issue is resolved now. Thank you!