[Resolved] The best way for A Custom Post type Structure
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 thread is resolved. Here is a description of the problem and solution.
Problem:
Needed to create a small school site by using the CPT and taxonomies. What is the best way to structure the Custom Post types (Parent and child)?
Solution:
For this setup I would recommend to use CPTs and with one-to-many relationship between them.
- Classes cpt = will be parent
- Students and Teachers cpt = will be childs of classes cpt.
This support ticket is created 7 years, 1 month ago. 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.
I needed to create a small school site so I created the following:
Teachers (CPT - Custom Post Type)
Students (CPT)
Classes (CPT)
- Class A
- Class B
- Class C
I need when the teacher logs in he can only see his own class students (say Class A).
So my question here is:
What is the best way to structure the above Custom Post types?
Should i put the classes (A, B, C) as a Taxonomies for both Students and also for the Teachers or should I make it a separate Post Type as I made it above?
How can I make every teacher only sees his own class students?
What is the best way to establish the relationship between them?
Searching for an answer online i can see that this is a known problem for a lot of Toolset users and the answers always like: something wrong with your theme or your other plugins !!!.
So my question here is:
- If i use Number (4) as you can see on the screenshot attached nothing happened when selecting from the drop-down menu (Ajax not working)
- If i use Number (3) then i must add a Submit button and if i do add the Button it does not show on the front end and again the Ajax update not working
- If i use number (3) then i add Text search (input which i do not want and do not use) + Submit button (as you can see from the second screenshot) then everything is working fine
My theme developer said the theme does not block any Ajax call and i cleared all cash and disabled the rest of the plugin from my site plus tested the page on 3 different browsers but still did not work.
That’s technically a different issue. Please kindly open a new ticket for this 2nd issue and we would be happy to help. This will help other users with similar problems to find solutions when searching the forum, We do not handle multiple issues in the same ticket as per support policy. https://toolset.com/toolset-support-policy/
kindly mark this current ticket as resolved if all is good now.