Hi there,
We want to build a page with a view of filtered content for logged in users:
- The users selected a option (A / B / C) in their registration cred-form (options created by wp-types user-fields).
- The posts have a option (A / B / C) created by wp-types post-fields.
We want the loop which will be shown in the users personal page to be filtered by this option.
This page is only accessible after login.
The thing we need to build is a filter based on:
Logged in user:
wp-types user-fields: option 1 (A / B / C)
compare to
wp-types post-fields: option 1 (A / B / C)
AND
wp-types user-fields: option 2 (A / B / C)
compare to
wp-types post-fields: option 2 (A / B / C)
The posts with a hit are shown in this loop.
I hope this is clear enough and somebody can help me out te set this up.
Thanks on behalf!
Paul
Dear Paul,
Q1) This page is only accessible after login.
I suggest you use Access plugin to limit the access to the specific page, see our document:
Limiting read access to specific content
https://toolset.com/documentation/user-guides/limiting-read-access-specific-content/
Q2) We want the loop which will be shown in the users personal page to be filtered by this option.
You can use Views filter hook "wpv_filter_query" to add your custom filters, see similar thread:
https://toolset.com/forums/topic/create-a-query-filter-in-a-view-to-filter-on-wp-favorite-posts/
More help:
wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.
https://toolset.com/documentation/user-guides/views-filters/wpv_filter_query/
Hope it help
Hi Luoy,
Thanks for your reply, i've been reading these pages and hope you can help me a bit more.
Q1: The page is already locked by Acces so we got this covered.
Q2:
- We have a Cred form for registration where the 'wp-types user-fields' are filled in and stored in the users profile page.
- We have a Cred form for creating the post with the 'wp-types post-fields'.
This is our actual case. We want to filter to a wp-view, based on comparing a:
wp-types user-field: option 1 (A / B / C) compare to wp-types post-field: option 1 (A / B / C)
AND
wp-types user-field: option 2 (A / B / C) compare to wp-types post-field: option 2 (A / B / C)
Can you help me out to create this piece of code because i can't get my head around it...
That would be really great.
Thanks,
Paul
Dear Paul,
About the question Q2, as you can see, it needs custom PHP codes, according to our new support police, we can not provide the custom codes support:
https://toolset.com/toolset-support-policy/
But if you still need assistance for it, please duplicate same problem in a test site, and fill below private detail box with login details and ftp access, also point out the problem page URL, view URL and which one is the specific user field, which one is the specific custom post field. I can try setup a demo for you, thanks
Same problem as your another thread, the credentials for "Authentication Required" window does not work, please check it and update this thread when it is ready, thanks
Hi Luoy,
Our server is up and running again so you can enter...
Thanks,
Paul
Dear Paul,
I assume it is same test site of your another thread:
https://toolset.com/forums/topic/forms-for-creating-and-editing-child-content/
I see the error: 502 Bad Gateway
Please check it. thanks
Hi Luoy,
Nginx gave some issues.
You can enter if you like.
Thanks.
Paul
Hi Luoy,
I think you can enter now, you fixed all other issues 🙂
Thanks
Paul
Could you point out the problem page URL, view URL and which one is the specific user field, which one is the specific custom post field. I need test it in your website, thanks
Hi Louy,
I will create some content under your login (account), after that i will explain what we want to do.
It will take a day or two.
Thanks for your time.
Paul
OK, please update this thread when your test site is ready, thanks