Parent from different post type
It would be nice to have a way to set a parent entry from a different post type.
Initially this can simply be a setting when registering the post type -- parent_post_type = page. In case the idea evolves (and I'm sure it will) it can be implemented in a different way.
Yes! This is exactly what I need. I can't make the "Blog" link in my menu highlight as the active page when reading a single post since single posts are not recognised by WordPress as the child of the Blog page. Some way of assigning which menu link or page is the "parent" of the single posts would be a life saver.
Please everyone vote for this so it gets implemented!!
I actually had something else in mind. My suggestion had more to do with custom post types, instead "parent" classes in menu for blogposts.
I think you are looking for "Posts 2 Posts" plugin:
I am aware of the Posts2Posts plugin, yet I believe this is a very basic feature that should not be achieved through a plugin, rather it should be built into WordPress core.
You can already set a parent like this. In fact, WP core does it with attachments.
Although you might be able to do this programatically it renders permalinks irregular.
Moreover you are not allowed to do this through the admin panel, although it is a matter of a simple filter to change the post type for the items in the "Parent" dropdown.
This can be done via two filters (one for post edit, one for quick edit):
found in wp-admin/meta-boxes.php, line ~650
found in wp-admin/includes/class-wp-posts-list-table.php, line ~900
If you try this (like I did -- at least with the
page_attributes_dropdown_pages_args filter) you will run in all kinds of complications.
First is that the function that you pass the attributes from the
page_attributes_dropdown_pages_args filter is not actually get_posts (or in any way based on WP_Query), rather this uses
get_pages and prevents you from further using
I believe I mentioned in my previous comment that this part is easy. The follow-up issues have to do with invalid permalinks.
Other than that when the entries are listed in the admin panel the parent listed from a different post type is not very user friendly in my opinion.
I also need this function to creat a forum, a thread will open and any reply is a post's child
RSS feed for this topic
You must log in to post.