Adding custom post types to a plugin isn’t much different to a theme.
I’m working on this at the moment.
One suggestion I do have for people is to use the plugin activation and deactivation hooks to flush the rewrite rules.
Here’s a great plugin to bundle all your theme functionalities like CPT, taxonomies, metaboxes, shortcodes and widgets, thought I’d share.https://github.com/billerickson/Core-Functionality
Yeah, I created a plugin soon after the requirements were announced. It gives extra steps for users to do upon installation/update but it really is for the better.
I just wish authors would stop using custom post types. The problems they cause completely outweigh the 1 or 2 positives, which means they all eventually end up causing the buyers (and authors of other themes) a lot of unnecessary headaches.
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.