Skip to content

Instantly share code, notes, and snippets.

@tanjimahmmed
Created March 2, 2020 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanjimahmmed/0aa1ee6f47e3c3fee555168b7caa490e to your computer and use it in GitHub Desktop.
Save tanjimahmmed/0aa1ee6f47e3c3fee555168b7caa490e to your computer and use it in GitHub Desktop.
Register custom post
add_action( 'init', 'my_theme_custom_post' );
function my_theme_custom_post() {
register_post_type( 'cpt',
array(
'labels' => array(
'name' => __( 'CPTs' ),
'singular_name' => __( 'CPT' )
),
'supports' => array('title', 'editor', 'custom-fields', 'thumbnail', 'page-attributes'),
'public' => true
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment