From the course: WordPress: Custom Post Types and Taxonomies
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Where does the code belong? - WordPress Tutorial
From the course: WordPress: Custom Post Types and Taxonomies
Where does the code belong?
- [Instructor] WordPress does an incredibly good job of separating form from function. Primarily WordPress is for adding and editing content. If we want to control the design, we get a new theme, something that isn't married to WordPress Core or the content inside WordPress. If we want to add more features like a slider or contact form, we get a plugin. That means that content, design and features can be completely separate from each other. As a result, we need to take into consideration where the code for our custom post types and custom taxonomies belong. For a long time, these were added to the theme. If your theme has specific templates for a custom post type, it seemed to make sense that you'd include the custom post types there as well. However, a problem arises with this approach. If you decide to change the theme, you're effectively disabling content because it's attached to that theme. Instead we'll need to take a two-pronged approach, we'll create a plugin that houses our…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.