/* Custome Post Type */ add_action( 'init', 'wp_product' ); function wp_product() { register_post_type( 'wp_product', array( 'labels' => array( 'name' => __( 'WP Catalogue' ), 'singular_name' => __( 'Product' ), 'search_items' => __( 'Search Product' ), 'parent_item' => __( 'Parent Product' ), 'parent_item_colon' => __( 'Parent Product:' ), 'edit_item' => __( 'Edit Product' ), 'update_item' => __( 'Update Product' ), 'add_new_item' => __( 'Add New Product' ), 'new_item_name' => __( 'New Product Name' ), ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'products'), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'comments' ), ) ); } /*------------------------------------------------------------------------------------------------------*/ /* Custome Taxonomy Type */ function add_product_taxonomies() { register_taxonomy('p_category', 'wp_product', array( // Hierarchical taxonomy (like categories) 'hierarchical' => true, // This array of options controls the labels displayed in the WordPress Admin UI 'labels' => array( 'name' => _x( 'Product Category', 'taxonomy general name' ), 'singular_name' => _x( 'Category', 'taxonomy singular name' ), 'search_items' => __( 'Search Categories' ), 'all_items' => __( 'All Categories' ), 'parent_item' => __( 'Parent Categories' ), 'parent_item_colon' => __( 'Parent Categories:' ), 'edit_item' => __( 'Edit Categories' ), 'update_item' => __( 'Update Categories' ), 'add_new_item' => __( 'Add New Categories' ), 'new_item_name' => __( 'New Categories Name' ), 'menu_name' => __( 'Categories' ), ), // Control the slugs used for this taxonomy 'rewrite' => array( 'slug' => 'p_category', // This controls the base slug that will display before each term 'with_front' => false, // Don't display the category base before "/locations/" 'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/" ), )); } add_action( 'init', 'add_product_taxonomies', 0 );
Custome Post Type And Custom Taxonomy Type In WordPress
18 Friday Apr 2014
Posted WordPress
in
Fantastic post but I was wondering if you could write
a litte more on this topic? I’d be very thankful if you could
elaborate a little bit further. Thank you!
LikeLike
Welcome 🙂
LikeLike
Hi there are using WordPress for your blog platform?
I’m new to the blog world but I’m trying to get started and create my own. Do you need
any coding knowledge to make your own blog? Any help would be really appreciated!
LikeLike
Thanks and sure i help you…
please send your gmail or facebook id…
than i chat with you
LikeLike
Great info. Lucky me I recently found your site by accident (stumbleupon).
I have book marked it for later!
LikeLike
Reblogged this on deadmau5 is dead! and commented:
Custom post type and Custom taxonomy type init..
LikeLike