Skip to content

Instantly share code, notes, and snippets.

@AndreaBarghigiani
Created February 17, 2013 19:59
Show Gist options
  • Save AndreaBarghigiani/4973111 to your computer and use it in GitHub Desktop.
Save AndreaBarghigiani/4973111 to your computer and use it in GitHub Desktop.
Crea un nuovo Custom Post Type
<?php
// Creazione Custom Post Type Portfolio
add_action( 'admin_init', 'wpam_portfolio' );
function wpam_portfolio(){
$labels = array(
'name' => _x('Portfolio', 'la sezione per i nostri lavori', 'tuo-tema'),
'singular_name' => _x('Lavoro', 'un elemento del nostro portfolio', 'tuo-tema'),
'add_new' => _x('Aggiungi Nuovo', 'elemento', 'tuo-tema'),
'add_new_item' => __('Aggiungi un Nuovo Lavoro', 'tuo-tema'),
'edit_item' => __('Modifica Lavoro', 'tuo-tema'),
'new_item' => __('Nuovo Lavoro', 'tuo-tema'),
'all_items' => __('Tutti i Lavori', 'tuo-tema'),
'view_item' => __('Visualizza Lavoro', 'tuo-tema'),
'search_items' => __('Ricerca Lavori', 'tuo-tema'),
'not_found' => __('Nessun lavoro trovato', 'tuo-tema'),
'not_found_in_trash' => __('Non ci sono lavori nel cestino', 'tuo-tema'),
'parent_item_colon' => '',
'menu_name' => 'Portfolio'
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title', 'editor', 'thumbnail' )
);
register_post_type( 'portfolio', $args );
}// Fine wpam_portfolio
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment