Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // ADDS VARIOUS POST TYPES
- // Add post types and taxonomies in one swoop
- add_action( 'init', 'add_voodoo_post_types_and_taxonomies', 0 );
- function add_voodoo_post_types_and_taxonomies() {
- // Store theme directory in var
- $theme_dir = get_stylesheet_directory_uri();
- // Product post type
- register_post_type( 've_products', array(
- 'labels' => array(
- 'name' => __( 'Products' ),
- 'singular_name' => __( 'Product' ),
- 'add_new' => _x('Add New', 've_products'),
- 'add_new_item' => __('Add New Product'),
- 'edit_item' => __('Edit a Product'),
- 'new_item' => __('New Product'),
- 'view_item' => __('View a Product'),
- 'search_items' => __('Search Products'),
- 'menu_icon' => $theme_dir . '/images/voodooTitleDefault.png',
- 'not_found' => __('No products found'),
- 'not_found_in_trash' => __('No products found in Trash'),
- 'parent_item_colon' => ''
- ),
- 'public' => true,
- 'rewrite' => true,
- 'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail' ),
- ) );
- register_post_type( 'col_avs', array(
- 'labels' => array(
- 'name' => __( 'Hockey News' ),
- 'singular_name' => __( 'Hockey News' ),
- 'add_new' => _x('Add New', 'col_avs'),
- 'add_new_item' => __('Add Hockey News'),
- 'edit_item' => __('Edit Hockey News'),
- 'new_item' => __('New Hockey News'),
- 'view_item' => __('View Hockey News Item'),
- 'search_items' => __('Search Hockey News'),
- 'menu_icon' => $theme_dir . '/images/voodooTitleDefault.png',
- 'not_found' => __('No hockey news found'),
- 'not_found_in_trash' => __('No hockey news found in Trash'),
- 'parent_item_colon' => ''
- ),
- 'public' => true,
- 'capability_type' => 'post',
- 'show_ui' => true,
- 'rewrite' => true,
- 'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail' ),
- 'taxonomies' => array( 'post_tag', 'category'),
- ) );
- register_post_type( 've_members', array(
- 'labels' => array(
- 'name' => __( 'Our Members' ),
- 'singular_name' => __( 'Member' ),
- 'add_new' => _x('Add New', 've_members'),
- 'add_new_item' => __('Add a New Member'),
- 'edit_item' => __('Edit a Member'),
- 'new_item' => __('New Member'),
- 'view_item' => __('View a Member Profile'),
- 'search_items' => __('Search Members'),
- 'menu_icon' => $theme_dir . '/images/voodooTitleDefault.png',
- 'not_found' => __('No Members found'),
- 'not_found_in_trash' => __('No Member Profiles in Trash'),
- 'parent_item_colon' => ''
- ),
- 'public' => true,
- 'capability_type' => 'post',
- 'show_ui' => true,
- 'rewrite' => true,
- 'heirarchical' => true,
- 'supports' => array( 'title', 'editor', 'comments', 'custom-fields', 'thumbnail' ),
- ) );
- // Product taxonomy
- register_taxonomy( 'product_category', 've_products', array( 'hierarchical' => true, 'label' => 'Product Category', 'query_var' => true, 'rewrite' => true ) );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement