Wordpress - Create custom post-type

$post_type = 'name'; $labels = array( 'name' => _x('Name', 'post type general name'), 'singular_name' => _x('Name', 'post type singular name'), 'add_new' => _x('Add new', 'name'), 'add_new_item' => __('Add new name'), 'edit_item' => __('Edit name'), 'new_item' => __('New name'), 'all_items' => __('Show all'), 'view_item' => __('See name'), 'search_items' => __('Search mame'), 'not_found' => __('Not found'), 'not_found_in_trash' => __('Not found in trash'), 'parent_item_colon' => __(''), 'menu_name' => __('Name') ); $args = array( 'labels' => $labels, 'description' => 'Templates custom post', 'has_archive' => false, 'public' => true, 'show_ui' => true, 'supports' => array( 'title', 'excerpt', 'thumbnail', 'category' ), 'taxonomies' => array( 'taxonomies for this post-type' ), 'exclude_from_search' => false, 'capability_type' => 'post', 'menu_position' => 4, 'rewrite' => array('slug' => 'name-slug', 'with_front' => true), 'query_var' => true ); register_post_type($post_type, $args);
Create custom post-type in wordpress

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.