WordPress uses built-in post types for normal everyday use, but you can extend the list of available post types by using a pivotal function: register_post_type()
. It is this function that allows WordPress to fulfill more traditional CMS roles. For example, you could create a custom post type for "movies" with custom fields for "plot", "genre" and "rating". The important thing to realize is that any custom post types will be visible to WordPress only if you register them using the register_post_type()
function, and as you may have guessed, the only way for you to do that is inside a plugin.
To really understand what this complex function does, we really need to get our hands dirty and try using it ourselves. You guessed it, it's time for you to create another plugin.
We are naming this plugin "Content Chunks", so our first step is to create a folder named content-chunks
in the wp-content/plugins
folder, and then create our index.php
with a valid information...