add_action( 'init', 'custom_post_type', 0 ); //Define custom post types function custom_post_type() { // Set UI labels for Custom Post Type $workoutSchedule_labels = array( 'name' => _x( 'Workout', 'Post Type General Name', 'webtailor' ), 'singular_name' => _x( 'Workout', 'Post Type Singular Name', 'webtailor' ), 'menu_name' => __( 'Workouts', 'webtailor' ), 'parent_item_colon' => __( 'Workout padre', 'webtailor' ), 'all_items' => __( 'Tutti i workouts', 'webtailor' ), 'view_item' => __( 'Vedi workout', 'webtailor' ), 'add_new_item' => __( 'Aggiungi workout', 'webtailor' ), 'add_new' => __( 'Aggiungi workout', 'webtailor' ), 'edit_item' => __( 'Modifica workout', 'webtailor' ), 'update_item' => __( 'Aggiorna workout', 'webtailor' ), 'search_items' => __( 'Cerca workout', 'webtailor' ), 'not_found' => __( 'Not Found', 'webtailor' ), 'not_found_in_trash' => __( 'Not found in Trash', 'webtailor' ), ); // Set other options for Custom Post Type $workoutSchedule_args = array( 'label' => __( 'workoutSchedule', 'webtailor' ), 'description' => __( 'Workout plans', 'webtailor' ), 'labels' => $workoutSchedule_labels, // Features this CPT supports in Post Editor 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), // You can associate this CPT with a taxonomy or custom taxonomy. 'taxonomies' => array( 'genres' ), /* A hierarchical CPT is like Pages and can have * Parent and child items. A non-hierarchical CPT * is like Posts. */ 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 15, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', 'menu_icon' => 'dashicons-universal-access', ); // Registering your Custom Post Type register_post_type( 'workoutSchedule', $workoutSchedule_args ); }