Adding post type example to includes

This commit is contained in:
Your NameAntoine 2022-09-27 11:31:32 +02:00
parent 7b6f57d4f9
commit 10dfc1beff
2 changed files with 29 additions and 1 deletions

28
includes/post_types.php Normal file
View 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' );

View File

@ -1,5 +1,5 @@
/* /*
Theme Name: Deligraph Theme Name: Deligraph
Author: Deligraph Author: Deligraph
Author URI: https://deligraph.com/ Author URI: https://deligraph.com/
Version: 1.0.0 Version: 1.0.0