How to add custom post types without the CPT plugin in WordPress?
Muhammd Farhan Yaqoob
WordPress Certified Front-End Developer | UI/UX Specialist | HTML5 CSS3 BOOTSTRAP Expert | JavaScript Developer | Wix Expert | Website Optimization Engineer
Step 1: Create a Child Theme (Optional but Recommended)
Before modifying the functions.php file, it's a good practice to create a child theme to ensure your changes are not lost when the parent theme is updated. If you're not familiar with creating a child theme, you can find instructions in the WordPress Child Themes documentation.
Step 2: Visit GenerateWP
Visit GenerateWP website
Go to the GenerateWP Custom Post Type Generator.
Step 3: Fill Out the Form
You'll see a form with multiple fields. Fill in the fields according to the custom post type you want to create. Here’s an explanation of some key fields:
Labels Section
Fill in the labels for the custom post type. This includes names like Add New, Edit, View, etc. These labels will be used in the WordPress admin.
Settings Section
Configure the settings for the post type:
领英推荐
Step 4: Click on the Generate Code Button
The Code will be generated according to your given fields now you have to copy this code as it is and paste it into a file at the end of 'functions.php'
Final Steps
After adding the code to your theme or plugin:
By following these steps, you can create custom post types without using a plugin like CPT UI, using the GenerateWP tool to simplify the process.
If you liked this article, please like, follow, and share!