You may wish to use custom post types for:
- Secure posting from people less central to a group, so they can’t check categories to display on key pages (this is better than giving users permission to edit only certain categories)
- Creating a specific type of content on the site that is separate to other content, where advanced features like categories are needed
Setting up custom post type
Install and activate custom post type UI plugin
Adding custom post type
Go to add/edit post type
Fill in post type slug, plural label and singular label, eg:
- posts, posts, post
- page, pages, page
- Image, Images, Image
- Local, Local news and events, local news item
Adding custom taxonomy (category or tag)
Go to add/edit taxonomies
Fill out the lables, e.g.
- Category, Categories, Category or
- Group, Groups, Local Group
Check the box under Attach to Post Type for the post type you just made.
Category or tag?
To make it function like categories then under settings (scroll down a lot)
Set Hierarchical as true. Gor it to function like tags, leave it as false.
The setting for Show in quick/bulk edit panel is also useful, this allows quick edit to work on the custom content page, where you can select categories without editing the post.
You can also set a custom icon. Colour seems to be around the #ebebebff – not what it says with the colour picker, but the contrast dosen’t look right unless you make it super pale.
Displaying custom post type
You can use the list category posts plugin with a shortcode like the following
Where catlist taxonomy is the new content type name for categories, and the term is the category itself. More details here. Note that the singular of the taxonomy is used, not the plural – so topic not topic, group not groups.
Also, remember that changing the category names etc will stop the shortcode working.
See NECN site note that formatting info can be put in the shortcode and tied to css
Note the custom css section in the theme editor