Tell us what you are trying to do?
Hi. I have 2 CPTs which are related to eachother in many-to-many relationship. Both are created by Toolset. Lets name one CPT1 and the other CPT2. The CPT2 has a custom flat taxonomy (like Tags) which tells the "Type" of CPT2s. For example, the CPT2-1 is a Type1 and the CPT2-2 is a Type2.
I want to create a View in the Single Page of CPT1, in which I list all realted CPT2s. In this View, I want all related CPT2s be listed based on date created. The problem I have is here: I want those CPT2s that are Type1 to be "Post title with a link" in the list, and those CPT2s that are Type2, to be a normal "Post title" (without link).
How can I achieve this? Please help.
Thank you in advance.
Hello,
I assume you are going to achieve these:
In the single "CPT1" post, display a post view:
- Query related "CPT2" posts
- in view's loop, display such kind of link:
link text is CPT2s post term "Type2", link to CPT2s post URL
If it is, you can setup that link with HTML codes, for example:
<a href="[wpv-post-url]">[wpv-post-taxonomy type="type" separator=", " format="name" show="name" order="asc"]</a>
More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-taxonomy
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-url
Hello Lou,
Sorry I didn't understand. Could you please explain in more detail?
I have provided the example codes in above answer, if you still need assistance for it, please provide a test site with the same problem, fill below private message box with login details, also point out the problem page/post URLs, I can setup a demo for you