Welcome to the Course

Welcome! In this course you will learn how to use post types in WordPress.

Target audience

The course is aimed at developers who are looking to use post types to turn WordPress into a robust tool to manage any kind of content, like testimonials, customers, books, or whatever they need.

Prior knowledge of PHP programming is recommended.

Content

The course is organized as follows.

Frequently Asked Questions

How can I register a custom post type in WordPress?

The function register_post_type registers a post type in WordPress. You can call it directly in your code, or you can use a post type registration plugin that calls this function behind the scenes and does the heavy work for you. View details.

I get an HTTP 404 error when I try to visit an entry of a custom post type. What is wrong?

This problem happens because the post type was registered, but rewrite rules have not been flushed yet. Navigate to Settings > Permalinks to cause the flushing of rewrite rules. View details.

I need to modify a post type registered in a code out of my control. Is it possible?

Yes. WordPress passes the arguments of a post type through a filter before the post type is actually registered. Hook a function to the filter and modify the arguments of the post type as required. View details.

I followed the best practice of adding a prefix to the identifier of a post type, but I need to use a user-friendly slug on URLs. What can I do?

The identifier and the slug of a post type are different things. You can specify a value for each one during post type registration. View details.

I created various entries of a custom post type, but they are not being shown on the website. Why?

Custom post types are not added to the main query by default. You need to add the post type to the main query according to your needs. View details.