Skip Navigation

[Résolu] Filter posts based on user's saved categories

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created Il y a 6 années et 8 mois. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Marqué : ,

This topic contains 1 réponse, has 2 voix.

Last updated by Noman Il y a 6 années et 8 mois.

Assisted by: Noman.

Auteur
Publications
#544947

I've got a custom post type "Jobs" and a custom taxonomy "Job Types".

What I want to do is:

1. Have an area in my CRED add/edit user form with checkboxes where users can choose what "Job Types" they want to see.

2. On the "Jobs" view, only show jobs that match the "Job Types" that a user has preselected.

Any tips on how I might achieve this? I searched around on Google but couldn't really come up with anything too relevant.

Cheers!

#545075

Noman
Supporter

Languages: Anglais (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Brad,

Thank you for contacting Toolset support. This is a custom requirement and not possible using builtin options of Toolset. Problem here is that we can’t link same Category (taxonomy) to both Post Types and Users at same time. Also Toolset does not support user categories / taxonomies. There is a custom method to achieve this through coding. We would link Category (taxonomy) with Checkbox user field indirectly in this method, the steps would be as follows:

1. Create Custom Post Type “Jobs” (as you have already created).
2. Create taxonomy “Job Types” for above CPT >> add some categories.
3. Create a user field (checkboxes) and add same values as Job Types (categories) have.
4. Create two CRED Forms: 1 for Add User and 1 for Edit user.
5. Create view that will display specific post for specific job types selected by a user. This will need some custom coding to make it happen. Here are relevant hooks/filters:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_view_settings
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

6. To get values of the selected checkbox get_user_meta function will be used:
https://codex.wordpress.org/Function_Reference/get_user_meta
https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes

We have some recommended list of service providers here who can implement such things for you: https://toolset.com/consultant/

Thank you

Le forum ‘Types Community Support’ est fermé à de nouveaux sujets et réponses.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.