From the course: WordPress: Custom Post Types and Taxonomies

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Create an events post type

Solution: Create an events post type - WordPress Tutorial

From the course: WordPress: Custom Post Types and Taxonomies

Start my 1-month free trial

Solution: Create an events post type

(upbeat music) - [Narrator] Now that you've completed the challenge of creating an events type, I'm going to show you how I would solve the problem. So the first thing we'll do is copy our function that defines our business type. We're going to use this as a boilerplate for the events type. We'll copy the function in its entirety, and then we'll paste it below. We'll also change the function name to lil_register_event_type. Next, we'll change the labels. The first thing we'll do is delete all of the featured image labels here, and we'll just use the standard labels for that. Next, we'll change name to Events. We'll change singular_name to Event. We'll change archives to Events Calendar. And we'll change add_new and add_new_item to Add New Event. Moving down to our argument array, we're going to change the value of has_archive to events. We're going to change the menu_icon to dashicons-calendar. And then finally we will change register_post_type from business to event. The last thing…

Contents