For non-hierarchical post types, you need some custom code to enable a post parent metabox in the editor. A reference plugin exists on github https://github.com/mtekk/Post-Parents you may need to modify it to handle the post types you want to use (both the CPT for the metabox to show up in, and what posts show up in the parent post dropdown).
Thread Starter
hal09
(@hal09)
Thank you for your support.
I uploaded the Post-Parents directory.
And the “Parent” metabox appeared on the post page.
However, I have additional questions.
question 1
Is the Parent metabox a setting for specifying my parent?
question 2
Parent metabox had only fixed page as an option.
How can I specify a specific post?
Thread Starter
hal09
(@hal09)
Hi,
What is the status of this case?
I need help.
thank you.
The parent metabox allows setting a parent for the post, the reference plugin takes advantage the WordPress editor will save a parent_id for you if it is specified (so it’s literally a matter of setting the parent_id via some interface, hence the metabox).
As I mentioned in my previous reply, the reference plugin just adds the Page post type, if you wanted some other post type you need to modify what is in the parent_meta_box function. The call to wp_dropdown_pages may need to either have a different post type specified in its arguments, or completely replaced (I don’t remember if it actually allows specifying a different post type).
Thread Starter
hal09
(@hal09)
Thanks for your reply.
However, it is very advanced content for me, so I may not be able to understand everything correctly.
Is my understanding below correct?
[the breadcrumb traffic that I want to create]
TOP page > post X > post Y
-The function of the reference plugin (=”Post Parents”) is only to specify its own parent.
-In other words, in the above example, specify post X in the parent metabox of post Y.
-Specifically, you can set your own parent by specifying the “parent_id” of the parent post.
-However, by default in wordpress, it is not possible to specify the post type of post X.
-In order to make this configuration change, it is necessary to change the part called “wp_dropdown_pages” in the parent_meta_box function.
-Probably it can be done by the above method, but there is no official support.
best regards