From the course: WordPress: Custom Post Types and Taxonomies

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Warning: Custom post types in themes

Warning: Custom post types in themes - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

Warning: Custom post types in themes

- [Instructor] A common strategy in the Wordpress development world for a long time was to bundle custom post types and other functionality with the themes. The idea was that themes essentially depended on these post types, and the post types depended on the theme for them to be viewed properly. It also made selling commercial themes on marketplaces a bit easier. You didn't have to come up with new instructions to tell users how to install and enable the theme, and then install and enable a set of plugins you were including. However, best practice dictates that the custom post types and taxonomies be included in a plugin, and not a theme. There are a few reasons for this, but the root of it goes back to what we talked about earlier: a separation of concerns. Content should not be tied directly to the display. Users should be able to swap out the theme without losing their content. But there's also the philosophy that one should never say never. There could be legitimate reasons why…

Contents