-
Notifications
You must be signed in to change notification settings - Fork 14
Custom Post Types
Aleksey Motovilov edited this page Jul 13, 2016
·
1 revision
First of all you need to go to your theme config in themename/app/config.php
and find $post_types
variable. That is a simple array. To insert a custom post type just add a new value like:
'gallery' => array(
'config' => array(
'public' => true,
'exclude_from_search' => true,
'menu_position' => 20,
'has_archive' => true,
'supports' => array(
'title',
'editor',
'page-attributes',
),
'show_in_nav_menus' => true,
),
'singular' => __( 'Gallery', 'textdomain' ),
'multiple' => __( 'Galleries', 'textdomain' ),
),
The structure is the same as for register_post_type
function, described in Post Types with one exception that we have added Singular
and Multiple
keys to generate all required labels automatically.