Created
August 5, 2013 14:21
-
-
Save quagliato/6156280 to your computer and use it in GitHub Desktop.
Create a new post-type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dentro do functions.php no diretório do tema, adicione o seguinte código: | |
/* | |
* Post Type: NOME | |
*/ | |
add_action('init', 'post_type_register'); | |
function post_type_register() { | |
$labels = array( | |
'name' => _x('NOME', 'post type general name'), | |
'singular_name' => _x('NOME_SINGULAR', 'post type singular name'), | |
'add_new' => _x('Adicionar Novo', 'nome_do_post_type'), | |
'add_new_item' => __('Adicionar Novo NOME'), | |
'edit_item' => __('Editar NOME'), | |
'new_item' => __('Novo NOME'), | |
'view_item' => __('Ver NOME'), | |
'search_items' => __('Procurar NOME'), | |
'not_found' => __('Nada encontrado'), | |
'not_found_in_trash' => __('Nada encontrado na lixeira'), | |
'parent_item_colon' => '' | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => true, | |
'capability_type' => 'post', | |
'hierarchical' => false, | |
'menu_position' => null, | |
'supports' => array('title','editor','thumbnail') | |
); | |
register_post_type('nome_do_post_type', $args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment