CPT With Texonimy

/** custom post type * */
// Our custom post type function
/*
* Creating a function to create our CPT
*/

/* function custom_post_type() {

// Set UI labels for Custom Post Type
$labels = array(
‘name’ => _x(‘Products’, ‘Post Type General Name’, ‘twentythirteen’),
‘singular_name’ => _x(‘Product’, ‘Post Type Singular Name’, ‘twentythirteen’),
‘menu_name’ => __(‘Products’, ‘twentythirteen’),
‘parent_item_colon’ => __(‘Parent Product’, ‘twentythirteen’),
‘all_items’ => __(‘All Products’, ‘twentythirteen’),
‘view_item’ => __(‘View Product’, ‘twentythirteen’),
‘add_new_item’ => __(‘Add New Product’, ‘twentythirteen’),
‘add_new’ => __(‘Add New’, ‘twentythirteen’),
‘edit_item’ => __(‘Edit Product’, ‘twentythirteen’),
‘update_item’ => __(‘Update Product’, ‘twentythirteen’),
‘search_items’ => __(‘Search Product’, ‘twentythirteen’),
‘not_found’ => __(‘Not Found’, ‘twentythirteen’),
‘not_found_in_trash’ => __(‘Not found in Trash’, ‘twentythirteen’),
);

// Set other options for Custom Post Type

$args = array(
‘label’ => __(‘movies’, ‘twentythirteen’),
‘description’ => __(‘Product news and reviews’, ‘twentythirteen’),
‘labels’ => $labels,
// Features this CPT supports in Post Editor
‘supports’ => array(‘title’, ‘thumbnail’),
// You can associate this CPT with a taxonomy or custom taxonomy.
‘taxonomies’ => array(‘genres’),
/* A hierarchical CPT is like Pages and can have
* Parent and child items. A non-hierarchical CPT
* is like Posts.
*/
/* ‘hierarchical’ => false,
‘public’ => true,
‘show_ui’ => true,
‘show_in_menu’ => true,
‘show_in_nav_menus’ => true,
‘show_in_admin_bar’ => true,
‘menu_position’ => 5,
‘can_export’ => true,
‘has_archive’ => true,
‘exclude_from_search’ => false,
‘publicly_queryable’ => true,
‘capability_type’ => ‘page’,
// define Categories
//’taxonomies’ => array( ‘category’ ,’Product Category’),
);

// Registering your Custom Post Type
register_post_type(‘product’, $args);
} */

/* Hook into the ‘init’ action so that the function
* Containing our post type registration is not
* unnecessarily executed.
*/

//add_action(‘init’, ‘custom_post_type’, 0);
//
//add_action(‘init’, ‘product_taxonomies’, 0);
//
//function product_taxonomies() {
// register_taxonomy(‘productcategory’, ‘product’, array(
// ‘hierarchical’ => true,
// ‘label’ => ‘Product Categories’,
// ‘Type’ => true,
// ‘rewrite’ => true,
// ‘show_ui’ => true,
// ‘show_admin_column’ => true,
// ));
//}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s