Tell us what you are trying to do?
How can I add pull-down selections for relationships?
I have 2 custom post types "State" and "County" each County post belong to a "state." I already set up the relationship.
I already imported states and counties into corresponding post types. If you go my top page, you can choose a state(california) and counties(Alamenda...etc) come up afterword.
But I cannot do the same thing on post form.
hidden link
Please help me.
Hello,
I have checked the URL you mentioned above, I don't find "state(california) and counties", please check it:
hidden link
I assume we are talking about these:
1) Three post types:
- State
- County
- Posts
2) Two post type relationships:
- One-to-many relationship between "State" and "County"
- One-to-many relationship between "County" and "Posts"
You are going to create a post form for creating posts, with two dropdown menu fields:
- State
- County
If it is, there isn't such kind of built-in feature, you can setup only one direct parent field "County" in the post form.
So you might try this workaround:
Create a page with nested post view:
- Query "County" posts
- Filter by relationship between "State" and "County"
- In view's loop, display child form link for creating "post"
Thank you for your support.
I still don't understand what to do.
I added dropdown menus on (1) hidden link
But I still don't know how to connect with State and County post types times inside of the dropdown.
So when a user choose "California" from state, only counties in California shows up and choose.
As I stated previously. I have already achieved this on search and view on front end. here
You see example here(2) hidden link
I just want to do the same thing when the user create a post which is (1)
Please explain a little more in detail about how to achieve this.
I have checked the URL you mentioned above it is 404 error, please check it.
Here are details steps:
1) Create a post form for creating new "Posts", for example: "New post form"
2) Create a page "Create post page", display above post form "New post form"
3) Create a post view:
- Query "County" posts
- Filter by relationship between "State" and "County"
- In the content template of view's loop, display child form link for creating "post":
Make sure you are using classic editor, click button "Toolset Forms", click "Create Child Post Link", choose "Create post page"(step 2), see screenshot child-post-link.JPG
4) Put the post view into a wordpress page, and test it in front-end.
So user can search by "state" and find specific "County" post, and click the link to create related posts