LLM Prompts

Custom Post Type Generator for WordPress

Generates code for a custom post type in WordPress based on user specifications.

The method

Use this prompt within a chat-based LLM interface. Provide the requested specifications for the custom post type, including name, plural name, associated features (e.g., title, editor, thumbnail), and any taxonomies you need. Iterate based on LLM output.

The prompts

Prompt 1
I need to create a custom post type for 'Books' in WordPress. The plural name should be 'Books'. It should support 'title', 'editor', 'thumbnail', 'excerpt', and 'custom fields'. It should be associated with the 'category' and 'post_tag' taxonomies. Generate the PHP code to register this custom post type, including labels and arguments for the register_post_type function. Include comments to explain each section of the code. Adhere to WordPress coding standards and use best practices.
Prompt 2
Create a custom post type for 'Products' in a WooCommerce store. The plural name is 'Products'. Features: 'title', 'editor', 'thumbnail', 'excerpt', 'custom fields', and WooCommerce product data (price, SKU, attributes). Associate it with 'product_cat' and 'product_tag' taxonomies. Generate the PHP code for registration, including necessary WooCommerce compatibility code. Ensure it displays correctly within the WooCommerce admin interface and frontend product pages. Provide detailed comments to explain integration aspects.