Last active
March 21, 2017 20:01
-
-
Save marcosnakamine/4dbf81633c5d34b28b30cd29bc1bdae5 to your computer and use it in GitHub Desktop.
WordPress - Add new post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init','register_new_post_type'); | |
function register_new_post_type(){ | |
$args = array( | |
'label' => 'New Type', | |
'show_ui' => true, | |
'supports' => array( 'title', 'editor', 'thumbnail' ), | |
'public' => true, | |
'hierarchical' => true, | |
'has_archive' => true | |
); | |
register_post_type('new_post_type',$args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment