Look, if you’ve been trying to add custom post types to your WordPress site, you probably know the pain. Most tutorials tell you to edit your functions.php file directly, but that’s scary stuff because one wrong move and your whole site breaks. Plus, when you update your theme, boom, all your custom code is gone.
That’s where this combo comes in handy. We’re gonna use PressXO CPT Generator to create the code for us, then host it safely with WPCodeBox. No more worrying about breaking your site or losing your work. You get your custom post types, taxonomies, and fields without touching any core files. Pretty neat, right?
Generate Custom Post Type Code
Head over to PressXO CPT Generator and you’ll see a clean form with several sections. Start with the Basic Information section, where you’ll enter your post type details.
Step 1: Fill Basic Information
- Go to PressXO CPT Generator
- In “Post Type Key” field, type: movie (lowercase, no spaces)
- In “Singular Name” field, type: Movie
- In “Plural Name” field, type: Movies
- Leave “Text Domain” as “your-theme” or change to your theme name
- In “Description” box, write: Movie information post type
- In “Custom Title Placeholder”, type: Enter movie title here
Step 2: Set Visibility & Access
- Check the “Public” box (should be checked by default)
- Check “Publicly Queryable”
- Check “Show UI”
- Leave “Exclude from Search” unchecked (so movies show in search)
- Check “Show in Nav Menus” if you want menu navigation
- Leave “Show in Admin Bar” unchecked (unless you really want it)
Step 3: Configure Menu Settings
- In “Show in Menu” dropdown, select “Top Level Menu”
- Leave “Menu Position After” as “Default”
- In “Menu Icon” field, type: dashicons-video-alt3
- You can browse other icons at WordPress Dashicons if you want something different
Step 4: REST API Settings
- Check “Show in REST API” if you use REST API or headless WordPress
- Leave “REST API Base Slug” empty (it’ll use the post type slug)
Step 5: Archive & URL Settings
- Check “Has Archive” (creates yoursite.com/movies page)
- Check “Query Var” (allows custom URL parameters)
- Leave “Custom Archive Slug” and “Custom Rewrite Slug” empty
Step 6: Choose Capabilities
- Check “Title” (must have)
- Check “Editor” (must have)
- Check “Thumbnail” (for featured images)
- Leave “Author” unchecked unless you need it
- Leave “Excerpt”, “Comments”, “Revisions”, “Page Attributes” unchecked for now
Step 7: Generate Code
- Click the generate button
- You’ll see PHP code appear on the right side
- Click “Copy Code” button to copy it
- Keep this code ready for WPCodeBox
The generated code will look something like the function you see in the screenshot. It creates all the labels, settings, and registers your post type properly.
Host CPT Code with WPCodeBox
Now let’s get that code into your WordPress site safely:
Step 1: Access WPCodeBox
- Go to your WordPress admin dashboard
- Look for “WPCodeBox” in the left menu
- Click on it to open the main interface
Step 2: Create New Snippet
- Click the “New Snippet” button (usually at the top)
- You’ll see a form with different fields to fill out
Step 3: Set Snippet Type
- In the “Snippet Type” dropdown, select “PHP”
- This tells WPCodeBox you’re adding PHP code, not CSS or JavaScript
Step 4: Add Your Code
- In the big code editor box, paste the PHP code you copied from PressXO
- Don’t add <?php tags – WPCodeBox handles that automatically
- The code should start with something like “function create_movie_cpt()”
Step 5: Name Your Snippet
- In the “Title” field, type something like: Movie Custom Post Type
- Keep it descriptive so you remember what it does later
Step 6: Set Where to Run
- Look for execution settings (might be called “Location” or “Run”)
- Select “Everywhere” or “Site Wide” since post types need to work globally
- Don’t restrict it to specific pages
Step 7: Configure Priority
- Leave priority as default (usually 10)
- Higher numbers run later, lower numbers run earlier
Step 8: Save and Activate
- Click “Save Snippet” button
- Toggle the “Active” switch to ON (or click “Enable”)
- You should see a green indicator showing it’s active
Step 9: Check if It Worked
- Go to your WordPress admin menu
- Look for “Movies” in the left sidebar
- If you see it with your movie icon, congrats – it worked
That’s it. Your custom post type is now live without touching any theme files. If you ever need to turn it off, just toggle the switch in WPCodeBox.
