简体   繁体   中英

Wordpress Custom Post Type Category System

I currently have a custom post type Projects that I need to have a categorization system. Basically, I need to have the page heirarchy as such: Projects -> Project Listing -> Main Project Page.

Does anyone know a preferred method of doing this? I currently have a page set up for all projects and that works fine. That pulls in all categories. The next step would be sorting project listings based on category. I need to set custom templates for these as well. Am I on the right track here, or is there a simpler approach that anyone can think of. Also, currently if make a page projects/project-listing it doesn't use my custom template I created. It seems to use the index.php template, which is not what I want. I need to have the url structure to be as listed. projects/project-listing

Any help would be greatly appreciated.

Okay, After Wordpress 4.7 custom templates are also available to custom post types, when defining a template

// your code here you can add this while making post type projects 'supports' => array( 'title', 'editor','page-attributes' )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM