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.
Displaying your post type on the front end - WordPress Tutorial
From the course: WordPress: Custom Post Types and Taxonomies
Displaying your post type on the front end
With all of our settings in place, let's test our custom post type and see how it looks on the front end. First, we'll add a new business. Go to Businesses, Add New. This will look near exact to the post editor interface. Since we have the REST API enabled, we see the block editor. The main difference is our custom labels. You'll notice, for instance, that the featured image box uses the logo labels we set. Let's go ahead and add a business name, and then we'll add some text about the business. We'll add a featured image. And then we'll click publish. When we click View Business, you'll notice that our business uses the default single.php template for our theme. We'll learn how to customize that later. Also take note of the URL. Notice that the slug is business/business name. That's due to our rewrite rule and has front settings. Finally, if we change the slug to /businesses, we'll be taken to the archive. Something to point out here is that we don't see our business directory archive…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.