Skip Navigation

[Resolved] Post reference, in the same post type

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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by Christian Cox 6 years ago.

Assisted by: Christian Cox.

Author
Posts
#1179300

Purging works fine. No more issues.
One additional question: I created a custom filed/ post reference. The posts I want to reference to (and only show the title) are from the same post type (Mots) but "Mots" is the only post type that is grey out and can't be selected.
How can I go around this?

#1179303

It's not currently possible to create post relationships or post references between posts of the same post type. Sometimes a taxonomy-based approach can be used as a workaround, giving you the ability to show related posts based on a taxonomy term filter.

Most flexible solution:
- Create a custom taxonomy and create a term that corresponds to each post's slug
- Apply related post terms to the desired related posts. For instance, if you want to relate posts "red" and "burgundy", then you would add the term "red" in the burgundy post, and add the term "burgundy" in the red post.
- Create a View of posts filtered by term slug, and pass the current post's slug into the term filter.
- It's tedious, but very flexible because you can create links between arbitrary posts.

Less flexible but simpler solution:
- Use the same taxonomy term to categorize related posts. In this case, "red" and "burgundy" posts would both get the taxonomy term "color".
- Create a View of posts filtered by term slug, passing the current post's term slugs into the term filter.

#1180174
Screen Shot 2019-01-08 at 9.00.21 AM.jpg
Screen Shot 2019-01-08 at 8.56.39 AM.jpg

Thanks - I will try these options. But I have difficulties showing on the frontend the taxonomy.
I have "evidences" posts that have a many to many relationship with the "mots" post. I can show on the "mots" post the "evidence" based on taxonomy filters but I can't seem to show in a different view the taxonomy itself, that would be as an example (see image attached):
Principe
– Nous Rappelle
–– B - Beith - 2 - Réceptivité

I can show the first level taxonomy with options for URL and links but I can't show the2nd and 3rd level taxonomy.

Thank you

#1180198

I can show the first level taxonomy with options for URL and links but I can't show the2nd and 3rd level taxonomy.

Can you show me how your taxonomy View is set up? Is there a nested View of child terms? Are there any Query Filters?

#1180218

Thanks - No I don't think I have a nested view. You can login at
hidden link
How can I give you the credentials?

#1180254

Yes please, here are private reply fields.

#1180986

I'm looking at this View:
hidden link
I can see you have two Query Filters:
- Taxonomy Term parent
- Specific Taxonomy Terms
Since "Taxonomy Term parent" is set to "Principe", only terms that are children of Principe will ever be shown here. This means 2nd level and 3rd level will never be shown in this View, unless you create a nested View. I'm not sure what you are trying to accomplish with the Specific Taxonomy Term filter.

- Create another View of the Niveaux taxonomy. This will display the 2nd level terms.
- Add a taxonomy term parent filter, where the parent term is set by the current term in the loop
- In the Loop, you can insert information about the term like the term archive link.
- Edit the "Nous Rappelle Taxonomy" View. Inside the wpv-loop tags, insert your new View.

- Create another View of the Niveaux taxonomy. This will display the 3rd level terms.
- Add a taxonomy term parent filter, where the parent term is set by the current term in the loop.
- In the Loop, insert information about the term, like the term archive link.
- Place this View inside the wpv-loop tags of the 2nd level View.

Now you should have a nested View structure that will display all 3 levels of terms. Place the 1st level View on your site.