Add Custom Post Type
Creates a custom post type
PHP
function create_custom_post_type() {
register_post_type('custom_type',
array(
'labels' => array(
'name' => __('Custom Posts'),
'singular_name' => __('Custom Post')
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail')
)
);
}
add_action('init', 'create_custom_post_type');
Snippet Feedback
Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY