Adding post type example to includes
This commit is contained in:
parent
7b6f57d4f9
commit
10dfc1beff
28
includes/post_types.php
Normal file
28
includes/post_types.php
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// #### POST TYPES
|
||||||
|
function create_posttype() {
|
||||||
|
|
||||||
|
register_post_type( 'example',
|
||||||
|
// CPT Options
|
||||||
|
array(
|
||||||
|
'labels' => array(
|
||||||
|
'name' => __( 'Scientific Publications' ),
|
||||||
|
'singular_name' => __( 'Publication' )
|
||||||
|
),
|
||||||
|
'public' => true,
|
||||||
|
'has_archive' => true,
|
||||||
|
'rewrite' => array('slug' => 'example'),
|
||||||
|
'show_in_rest' => true,
|
||||||
|
'menu_icon' => 'dashicons-analytics',
|
||||||
|
'menu_position' => 4,
|
||||||
|
'supports' => array ( 'title', 'custom-fields' ),
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
add_action( 'init', 'create_posttype' );
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user