How can I create multiple Custom Post Types?

function create_new_ansprechpartner()
{
$labels = array(
    'name' => _x('Ansprechpartner', 'Ansprechpartner', 'ubert'),
    'singular_name' => _x('Ansprechpartner', 'Ansprechpartner', 'ubert'),
    'menu_name' => __('Ansprechpartner', 'ubert'),
    'edit_item' => __('Ansprechpartner bearbeiten', 'ubert'),
    'add_new_item'          => __( 'Neuer Ansprechpartner', 'ubert' ),
    'update_item'           => __( 'Ansprechpartner aktualisieren', 'ubert' ),
    'view_item'             => __( 'Ansprechpartner ansehen', 'ubert' ),
    'not_found_in_trash' => __('Not found in Trash', 'ubert')
);
$args   = array(
    'labels' => $labels,
    'description'       => __('Ansprechpartner', 'ubert'),
    'supports'          => array('title', 'author', 'editor', 'thumbnail', 'excerpt', 'revisions', 'custom-fields'),
    'menu_icon'         => 'dashicons-welcome-write-blog',
    'menu-position'     => null,
    'public'            => true,
    'publicly_queryable'=> true,
    'show_ui'           => true,
    'show_in_menu'      => true,
    'show_in_admin_bar' => true,
    'rewrite'           => array( 'slug' => 'unsere-ansprechpartner' ),
    'capability_type'   => 'post',
    'can_export'        => true,
    'has_archive'       => false,
    'hierarchical'      => false,
    'publicly_queryable'=> true
);

register_post_type('uansprechpartner', $args); 
    $labels = array(
    'name'              => esc_html__( 'Abteilungen', 'ubert' ),
    'singular_name'     => esc_html__( 'Abteilung', 'ubert' ),
    'search_items'      => esc_html__( 'Abteilung suchen', 'ubert' ),
    'all_items'         => esc_html__( 'Alle Abteilungen', 'ubert' ),
    'parent_item'       => esc_html__( 'Parent Category', 'ubert' ),
    'parent_item_colon' => esc_html__( 'Parent Category:', 'ubert' ),
    'edit_item'         => esc_html__( 'Abteilung bearbeiten', 'ubert' ),
    'update_item'       => esc_html__( 'Abteilung aktualisieren', 'ubert' ),
    'add_new_item'      => esc_html__( 'Abteilung hinzuf├╝gen', 'ubert' ),
    'new_item_name'     => esc_html__( 'New Category Name', 'ubert' ),
    'menu_name'         => esc_html__( 'Abteilungen', 'ubert' ),
);


register_taxonomy( 'uansprechpartner_category', array( 'uansprechpartner' ), array(
    'hierarchical'      => true,
    'labels'            => $labels,
    'show_ui'           => true,
    'show_admin_column' => true,
    'query_var'         => true,
) );
$labels = array(
    'name'              => esc_html__( 'Ansprechpartner Tags', 'ubert' ),
    'singular_name'     => esc_html__( 'Ansprechpartner Tag', 'ubert' ),
    'search_items'      => esc_html__( 'Search Tags', 'ubert' ),
    'all_items'         => esc_html__( 'All Tags', 'ubert' ),
    'parent_item'       => esc_html__( 'Parent Tag', 'ubert' ),
    'parent_item_colon' => esc_html__( 'Parent Tag:', 'ubert' ),
    'edit_item'         => esc_html__( 'Edit Tag', 'ubert' ),
    'update_item'       => esc_html__( 'Update Tag', 'ubert' ),
    'add_new_item'      => esc_html__( 'Add New Tag', 'ubert' ),
    'new_item_name'     => esc_html__( 'New Tag Name', 'ubert' ),
    'menu_name'         => esc_html__( 'Tags', 'ubert' ),
);
register_taxonomy( 'uansprechpartner_tag', array( 'uansprechpartner' ), array(
    'hierarchical'      => false,
    'labels'            => $labels,
    'show_ui'           => true,
    'show_admin_column' => true,
    'query_var'         => true,
) );

}
add_action('init', 'create_new_ansprechpartner');
Without cookies
This website does not use cookies or tracking. More information can be found in the privacy policy.