Latest Post

How to Creating custom post Type in Wordpress

How to Creating custom post Type in Wordpress

How to Creating custom post Type in Wordpress


This code use for you can creating custom post Type.

<?php
function create_service_post_type() {
register_post_type( 'service',
array(
'labels' => array(
'name' => 'Service',
'singular_name' => 'Cafe',
'add_new' => 'Add New',
'add_new_item' => 'Add New service',
'edit_item' => 'Edit service',
'new_item' => 'New service',
'view_item' => 'View service',
'search_items' => 'Search service',
'not_found' =>  'Nothing Found',
'not_found_in_trash' => 'Nothing found in the Trash',
'parent_item_colon' => ''
),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
//'menu_icon' => get_stylesheet_directory_uri() . '/yourimage.png',
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','thumbnail')
)
);
}

add_action( 'init', 'create_service_post_type' );

?>

No comments