Creating a post type
Create a post type when you need a new kind of content that isn't just another blog post, such as Books, Writers or Team members.
The key is permanent
When you click Create, you enter a singular and a plural name, and VX suggests a Key. The key is how WordPress stores the post type and how its URLs start, and you can't change it after creation.
- Up to 20 characters: lowercase letters, numbers, hyphens and underscores.
- It can't match an existing post type or taxonomy; the two share one set of names.
- WordPress reserves some words for its own URLs (such as
author,category,name,year), and VX refuses them.
A badge next to the field shows Valid or Taken as you type. Choose book, not book-test: a test key becomes your production key.
Keep the built-in features
A new post type starts with a title, the content editor and a featured image. Keep them. They work everywhere themes, SEO plugins and search expect them, and a VX field can't fully replace them.
| You need | Use | Don't add a field for it |
|---|---|---|
| A name | The post title | A Text field called "Name" |
| The main description | The content editor | A Rich text "Description" field |
| A cover image | The featured image | An Image field for the same photo |
| A short summary | The excerpt (turn it on under Editor) | A Textarea "Summary" field |
Use fieldsets for everything these four don't cover: the address, the price range, the opening hours.
Add fields
Create a fieldset and give it a Post Type location that targets your new post type. The fields appear the next time someone edits an entry of that type.
Related
Technical details for LLMs
- Key validation (
vx-framework/v1/post-types/validate-key, and every create path):^[a-z0-9_-]+$, max 20, not a WordPress reserved query var, not an existing post type or taxonomy key. - New VX post types default to supports
title,editor,thumbnailon. Each support on the Editor tab is tri-state:auto/enabled/disabled. - Create with
vx-framework/create-post-type(required:key,singular_name,plural_name). Validate first withvx-framework/validate-config(type: post_type). - Before adding a field named title/name/description/content/summary/image, check whether the matching native support covers it.