Would something like this work? Am I missing anything?
function page_attributes_for_posts() {
register_post_type('job-bank-posts',
$args = array(
'hierarchical' => true,
'supports' => 'page-attributes'
);
);
};
add_action ('init', 'page_attributes_for_posts');
This is one of the sources I used:
https://developer.wordpress.org/reference/functions/register_post_type/
3
Answers
Maybe that will help, they added the parent feature for post
https://make.wordpress.org/core/2021/02/10/introducing-new-post-parent-related-functions-in-wordpress-5-7/
This plugin works perfect to make posts as parent https://wordpress.org/plugins/add-hierarchy-parent-to-post/
Maybe a complete example could be helpful:
Forgive me if this isn’t quite what you are after. OK, I managed to achieve something like this purely using WordPress’s built-in Permalink Settings. The other issue with this quick method is that you will no longer have the use of categories. But its works well for us.
go to wp-admin/options-permalink.php
Select: Custom Structure
you’ll want a structure like the following: /about/%category%/%postname%/
The category you choose for each post will become the parent for all posts under that category.
I then create an extra file in my template called ‘periodic-category.php’ :
You then want to create a page for each category and select periodic-category.php as the template in the post editor.
When ever you create a new post and select a category, it will be listed when you visit the category page.
The answer above provides you with the opportunity to add multiple parents pages for posts. If you simply want one parent page, then it is as follows:
I’m happy to share files etc if that is permitted here. Please forgive me as i am new. So happy to learn from others.