Skip to content

Instantly share code, notes, and snippets.

@matthijs166
Last active December 28, 2017 12:31
Show Gist options
  • Save matthijs166/a10abeead363c534c0ccb980feb168ad to your computer and use it in GitHub Desktop.
Save matthijs166/a10abeead363c534c0ccb980feb168ad to your computer and use it in GitHub Desktop.
create post types regsiter multiple post types
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