Creating a new post type
// Create post types
add_action( 'init', 'create_post_type' );
function create_post_type() {
// Portfolio
register_post_type( 'portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio' ),
'singular_name' => __( 'Portfolio item' )
),
'public' => true,
'has_archive' => true,
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'revisions' )
)
);
}
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'advice',
array(
'labels' => array(
'name' => __( 'Советы покупателям' ),
'singular_name' => __( 'Совет' )
),
'public' => true,
'has_archive' => true,
)
);
}