LLM Prompts

Custom Post Type Content Generator

Generates code snippets for registering Custom Post Types in WordPress.

The method

Use this prompt in any LLM platform like ChatGPT. Provide specific details about the desired Custom Post Type, including fields, purpose, and target audience. Refine the output to match your project requirements for optimal results. Insert the response inside the functions.php of your wordpress theme. Remember to backup your wordpress theme.

The prompts

Prompt 1
I need a WordPress Custom Post Type for 'Books'. It should have the following custom fields: 'author' (text), 'publication_date' (date), 'genre' (select - options: Fiction, Non-Fiction, Sci-Fi, Fantasy), 'isbn' (text), and 'cover_image' (media). Generate the PHP code to register this Custom Post Type and its custom fields, including necessary labels and descriptions. The goal is to create a well-structured and easily manageable Custom Post Type for showcasing books on a website. The output should be properly commented and easy to integrate into a WordPress theme's functions.php file. Also include code for displaying the custom fields in the WordPress admin panel and on the front-end of the website.
Prompt 2
Create a Custom Post Type in WordPress for 'Events'. Include the following custom fields: 'event_date' (date and time), 'location' (text), 'description' (WYSIWYG editor), 'organizer' (text), and 'event_image' (media). Generate the PHP code required to register this Custom Post Type and associated custom fields. Consider the user interface for managing events within WordPress and include appropriate labels and descriptions. The purpose is to develop a robust and user-friendly system for managing and displaying events on a WordPress website. Include any necessary code for displaying event information on a single event page template. Also provide CSS styling suggestions for the custom fields to enhance the visual appeal of the event listings.