I'm using a custom taxonomy to insert a URL into a view that is used as a navigation menu, with an anchor, like this:
<a href="[wpv-post-taxonomy type="my-classes" format="url"]#[wpv-post-slug]">Post title</a>
This is how all my navigation works across many different classes. Almost all the posts have just one taxonomy term (they belong to only one class). I need help in the case that the post has more than one taxonomy term, that is, I use it for more than one class.
This is only the case for only about 75 out of the around 500 posts of this type, so if I need to do something manually to make this work, that's ok. But I can't figure out how to just call the one taxonomy term.
Here is an example - if the post has taxonomy terms "knitting-superstar," "magic-loop-socks," and "toe-up-socks," the URL returned in the navigation looks like this:
<a href="/knitting-superstar/post-slug, /magic-loop-socks/post-slug, toe-up-socks/post-slug.">Post title</a>.
Clicking that link takes me to the first URL in that list, which is not the right one.
For the navigation, I need to specify that the chapter belongs to a certain term only. When I'm on the page for toe-up-socks archive, that chapter belongs to that term.
You can see in the screenshot that when I hover over the link for "Toe-Up Sock Pattern," the URL preview at the bottom shows the comma-separated list of URLs. I need it to go to just one URL - the right one.
Here's that page: hidden link
Can you help me think of a way to only return one term's URL just for certain classes?
Here is the view that displays the sidebar menu items - the code at issue is highlighted in the screenshot.
hidden link
I'm happy to create another taxonomy or custom field to label these special posts in some way, but I don't know how to limit or filter the results of this code [wpv-post-taxonomy type="my-classes" format="url"].
Thank you,
Liat