I am trying to use a Legacy View in different pages, to show a slider with related posts (from the same custom post type). The posts are related via a custom taxonomy.
What is the link to your site? hidden link Here, one post should appear in the slider, but it shows no results. (the sliders are at the end of the pages)
Here hidden link the slider should show 3 posts (the ones selected in the taxonomy:hidden link), and instead is shows 10.
Hello. Thank you for contacting the Toolset support.
Can you please share admin access details and let me review that how you configure the view?
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Well, now it's a bit worse than before really: I am getting the same wrong results as before, only now also the current post is showing in the slider - and I don't want that, that is why I had "don't include current page" checked...
On edit page I can see the term assigned to this post is "AE-MP" for taxonomy "Autoclaves relacionadas".
- hidden link
We can set the taxonomy filter to:
Autoclaves relacionadas the same as the page where this View is shown
When I checked the "AE-MP" it has assigned only one post and that is the same post where you claim that it should display only 1 result.
- hidden link
It will display the 1 result if you uncheck the checkbox setting "Don't include current page in query result" because its the same post where you assigned the term "AE-MP". If you keep checked the setting ""Don't include current page in query result"" then it will not display the result that is the same post.
Actually - its showing the correct result as per the settings you set. Try to assign the term "AE-MP" to another post and you should see that post on the following post: hidden link
The product "AE-MP" (hidden link) has assigned the post "TLV-MP" in the "autoclaves relacionadas" taxonomy, and that is the only product that should appear in the slider. Instead, it shows 6 posts that have no relationship with AE-MP within the "autoclaves relacionadas" taxonomy.
If I uncheck "Don't include current page in query result", I still get the 6 wrong product, plus the AE-MP itself...
The page hidden link instead, is the page for the product "TLV-MP". It has "AE-MP" assigned in the taxonomy, and that is the product that should appear in the slider. Instead, the slider is empty. I I uncheck "Don't include current page in query result", I get one product in the slider, which is the product TLV-MP: the wrong one, since it's the current page, while the slider should show product "AE-MP" instead...
If you set your view to query taxonomy "Autoclaves relacionadas" where the page is displayed.
For instance - for this post: hidden link
For the above post the term assigned is "AE-MP" for the taxonomy "Autoclaves relacionadas" :
- hidden link
To your view - you added the query filter to filter posts for this view:
- hidden link
Taxonomy Query Filter added:
Select posts with taxonomy:
Autoclaves relacionadas the same as the page where this View is shown
- That means the query filter try to fetch the terms assigned to currently displayed post for the taxonomy "Autoclaves relacionadas" that is why if you load the following post:
- hidden link
It will filter and show results only for the terms "AE-MP" because for the above post the term assigned is "AE-MP".
I hope you are getting me now.
It seems you want to involve here another taxonomy - doesnt it?
For the hidden link post, the term assigned in the taxonomy is AE-MP, that is correct.
Then, if the query filter try to fetch the terms assigned to currently displayed post for the taxonomy "Autoclaves relacionadas", the post hidden link shouldn't the results be for the terms AE-MP?
The only result it shows is TLV-MP...
Is there any other way to achieve what I need?
That is, for the slider to show the products selected in the "autoclaves relacionadas" taxonomy
In the hidden link example, it should show this post: hidden link
I think I understand the way the filter works, and unfortunately it's not the way I need, so I wonder whether there is a different way to achieve the result I am looking for.
I see that if I choose a taxonomy as a filter, the results display all the product that share the same taxonomy.
Instead, I need a way to pick, from each post edit page, the other posts I want to appear in the slider, that will be different for each page
As I previously said, we do have to mention the posts: the ideal would be to mention them from within each post. Like, having a list of the other posts to select from.
I cannot mention the posts from the view, since the view is used on a dynamic template that is used for all the posts from the same custom post type, and the slider should show different results on each page.
And creating one view for each post and then "mention" the posts from within the view would make the system difficult to manage, (the website will be translated into 5 languages)
I find difficult creating another field/taxonomy to compare since the relationship among the posts is not equal: for instance, it happens that post B must appear on post A slider, but post A doesn't have to appear on post B... That is what is making it difficult
Following your advice, I am trying to create a custom field group to then add the posts id, but I am not sure which is the way to go.
I thought the way to go was choosing "post reference" as field, but there is no way to connect the same custom post type with itself. like i cannot create a relationship many-to-many within the same custom post type, and I think that is exactly what I am trying to do: establishing a many to many relationship among posts of the same type...
I suggest to add custom number field.
- You can store the comma separated post ids to it
or
make this field repeating field so you can store one number per number instance.