Last active
December 28, 2017 12:31
-
-
Save matthijs166/a10abeead363c534c0ccb980feb168ad to your computer and use it in GitHub Desktop.
create post types regsiter multiple post types
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
function codex_custom_init() { | |
register_post_type( | |
'testimonials', array( | |
'labels' => array('name' => __( 'Books' ), 'singular_name' => __( 'Book' ) ), | |
'public' => true, | |
'has_archive' => true, | |
'menu_icon' => 'dashicons-cart', | |
'supports' => array('title', 'editor', 'thumbnail') | |
) | |
); | |
register_post_type( | |
'home-messages', array( | |
'labels' => array('name' => __( 'Cars' ), 'singular_name' => __( 'Car' ) ), | |
'public' => true, | |
'has_archive' => true, | |
'menu_icon' => 'dashicons-cart', | |
'supports' => array('title', 'editor', 'thumbnail') | |
) | |
); | |
} | |
add_action( 'init', 'codex_custom_init' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment