Freesnack
Custom post type freesnack theme
// Register Custom Post Type
function custom_post_type() {
$labels = array(
'name' => _x( 'Prodotti', 'Post Type General Name', 'freesnack' ),
'singular_name' => _x( 'Prodotto', 'Post Type Singular Name', 'freesnack' ),
'menu_name' => __( 'Prodotti', 'freesnack' ),
'parent_item_colon' => __( 'Prodotto genitore:', 'freesnack' ),
'all_items' => __( 'Tutti prodotti', 'freesnack' ),
'view_item' => __( 'Vedi prodotti', 'freesnack' ),
'add_new_item' => __( 'Aggiungi prodotto', 'freesnack' ),
'add_new' => __( 'Aggiungi nuovo', 'freesnack' ),
'edit_item' => __( 'Modifica prodotto', 'freesnack' ),
'update_item' => __( 'Aggiorna prodotto', 'freesnack' ),
'search_items' => __( 'Cerca prodotto', 'freesnack' ),
'not_found' => __( 'Non trovato', 'freesnack' ),
'not_found_in_trash' => __( 'Non trovato nel cestino', 'freesnack' ),
);
$rewrite = array(
'slug' => 'prodotti',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'prodotti', 'freesnack' ),
'description' => __( 'Gestione prodotti', 'freesnack' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'custom-fields', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-admin-page',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'query_var' => 'prodotti',
'rewrite' => $rewrite,
'capability_type' => 'page',
);
register_post_type( 'prodotti', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_post_type', 0 );