WordPress gives you the means to add new post types. In this hands-on lab, you will explore configuring and registering a new custom post type. You are actively building a team biography plugin, where team members are displayed on a business-centric website.
You are going to be amazed at how easy it is to configure and register your own custom post types. When your project needs a portfolio, event, FAQ, glossary, team bios, or whatever special content classification, you will know the ins and outs of how to add these to your project.
What You Will Learn
In this lab you will learn:
- What a “Custom” post type is
- How easy it is to register a new one with a couple lines of code
- How and Why to configure the labels to make the back-end interface specific for this new post type
- Configuring support features including how to include features that you may not know about at build time
- The why and how of flushing the rewrite rules
- Best practices for flushing the rewrite rules
- A basic overview of the configurable arguments
In order to do this lab, you will need your local sandbox site spun up and ready to go. See this Help Center article to get your sandbox ready.
We highly recommend that you complete this lab first:
You may want to read this article either before or after you take this lab:
Your functions are bloated. Put them on a diet. Think "skinny" and "as few lines as possible."
Total Lab Runtime: 01:20:49
- 1 Lab Introductionfree 02:33
- 2 What is a Custom Post Type?free 03:12
- 3 Plugin Overviewpro 12:09
- 4 Minimum Configurationpro 07:18
- 5 Configure Labelspro 12:52
- 6 Configure Post Type Featurespro 07:21
- 7 Exclude Post Type Featurespro 08:25
- 8 Flush Rewrite Rulespro 13:44
- 9 Configuring Argumentspro 10:48
- 10 Wrap it Uppro 02:27
In this hands-on lab, you and I will walk through the entire process of adding a new feature to an existing WordPress plugin. You'll start with the Collapsible Content plugin and then add a FAQ feature to it. This feature will require you to plan, think, and execute building a custom post type, custom taxonomy, advanced SQL queries, custom archive, and shortcode.
Check out the WordPress Fundamentals Library for more hands-on labs, insights, Docx, and more.
Check out the series page for more labs: WordPress Built-in and Custom Post Types