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.

Adding custom post types to themes

Adding custom post types to themes - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

Adding custom post types to themes

- [Instructor] As stated earlier, it's strongly recommended that custom post types and taxonomies stay in a separate plugin so that there's no reliance on the theme to create content. That said, here I'll show you how to add the post types and taxonomies we created into our 2019 theme. So we have a fully working plugin here in its own folder with its structure and organization. We could copy all of the code from all of those files directly into our functions.php file and everything will work fine. But we like to keep things organized. So the first thing we'll do is go to our demo site and we'll deactivate our plugin. You'll see the businesses and events disappear. Now if we go back to our code editor, we're going to copy the entire plugin folder, lil-post-types and past it in the child theme folder, 2019 child theme. Now in our child theme's functions.php file, we're going to add this line. We're going to add this to the top of our functions.php file so that any functions we wrote…

Contents