create_post-type.php

// 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); }
Create a new post-type

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.