I have a post type "Mots" and a post type "Concept". I created a many to many relationship between the 2, with 2 custom fields "Principe Dynamic" and "Portrait". I created a view for this relationship, it works fine until I added a"Custom field filter".
Not sure what I am doing wrong. All screenshots are attached. Not sure what I am doing wrong.
Hello,
I assume you are using two custom fields "Principe Dynamic" and "Portrait" in post type "Concept", how do you setup those two custom fields.
Please edit them, make sure you are using the same field value as you setup in Views filter:
hidden link
For example, if it is a custom select field, you can edit it, get the field value in option's "Custom field content", see screenshot
Custom-field-content.JPG
I am using the same Custom Fields Content. I have a mot "Test" with 2 Concepts to Mots relationships under "Nous Rappelle" but there is no items found.
Please check these:
1) You are using the latest version of Toolset plugins
2) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, and test again
3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
Thanks for the details, for security reason, I have changed your post to private message, it is not safe to share your website credentials publicly.
Here are what I found, please check the relationship settings:
hidden link
Those custom fields are setup in the intermediate post type "concept-mot", they are not in the post type "concept", so it conducts the problem you mentioned above.
I have done below modification in your website, edit the view "Nous Rappelle Concept A – Aleph – 1 – Principe créatif":
hidden link
- In section "Content Selection", switch to option "Concepts to Mots Intermediary Posts"
- in section "Query Filter", setup the relationship filter to:
Select posts in a Concepts to Mots relationship that are related to the Post where this View is shown.
- in section "Loop Editor", change the content template shortcode to:
[wpv-post-body view_template="loop-item-in-nous-rappelle-concept" item="@concept-mot.parent"]
test it in front-end:
hidden link
It works fine.
The logic is:
In many-to-many relationship, you can setup post view to:
- Query the intermediate post type
- and display related post information
I copied and pasted the view code from the test site to the live site without success.
I am getting the view query results on the "A classer" section, but not the "Nous Rappelle..." view.
I copied this
hidden link
to this
hidden link
with no success.
At this point I am not sure what I am doing wrong. (You have the same credentials for the live site and test site)
Thanks
Please point out the problem page URL, where can I see the screenshot you mentioned above:
hidden link
The view is
hidden link
The page admin is
hidden link
The page front
hidden link
Thank you.
There should be some miss-typo in the field filter, I have done below modification in your website:
Edit the post view "Nous Rappelle Concept A – Aleph – 1 – Principe créatif":
in section "Query Filter", change the custom field filter to:
Select items with field:
Portait is a string equal to A – Aleph – 1 – Principe créatif
Please test again, check if it is fixed, you can get the option value here:
hidden link
I am still not sure what I was doing wrong as I just copied and pasted the info. Anyway I duplicated yours and all the views seem to be working. Thanks. I have now to look at how I can show the item post link and all the information from the related post as well as the posts that are related to this related posts.
I assume the original question of this thread has been resolved:
https://toolset.com/forums/topic/filtering-a-view-relationship-with-custom-foelds/#post-1204869
Please create new ticket for other new questions, that will help other users to find the answers.