Advertisement
Guest User

My Post Steez

a guest
Dec 15th, 2010
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.89 KB | None | 0 0
  1. <?php
  2. // ADDS VARIOUS POST TYPES
  3. // Add post types and taxonomies in one swoop
  4. add_action( 'init', 'add_voodoo_post_types_and_taxonomies', 0 );
  5. function add_voodoo_post_types_and_taxonomies() {
  6.  
  7.     // Store theme directory in var
  8.     $theme_dir = get_stylesheet_directory_uri();
  9.    
  10.     // Product post type
  11.     register_post_type( 've_products', array(
  12.         'labels' => array(
  13.             'name' => __( 'Products' ),
  14.             'singular_name' => __( 'Product' ),
  15.             'add_new' => _x('Add New', 've_products'),
  16.             'add_new_item' => __('Add New Product'),
  17.             'edit_item' => __('Edit a Product'),
  18.             'new_item' => __('New Product'),
  19.             'view_item' => __('View a Product'),
  20.             'search_items' => __('Search Products'),
  21.             'menu_icon' => $theme_dir . '/images/voodooTitleDefault.png',
  22.             'not_found' =>  __('No products found'),
  23.             'not_found_in_trash' => __('No products found in Trash'),
  24.             'parent_item_colon' => ''
  25.         ),
  26.         'public' => true,
  27.         'rewrite' => true,
  28.         'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail' ),
  29.     ) );
  30.  
  31.     register_post_type( 'col_avs', array(
  32.         'labels' => array(
  33.             'name' => __( 'Hockey News' ),
  34.             'singular_name' => __( 'Hockey News' ),
  35.             'add_new' => _x('Add New', 'col_avs'),
  36.             'add_new_item' => __('Add Hockey News'),
  37.             'edit_item' => __('Edit Hockey News'),
  38.             'new_item' => __('New Hockey News'),
  39.             'view_item' => __('View Hockey News Item'),
  40.             'search_items' => __('Search Hockey News'),
  41.             'menu_icon' => $theme_dir . '/images/voodooTitleDefault.png',
  42.             'not_found' =>  __('No hockey news found'),
  43.             'not_found_in_trash' => __('No hockey news found in Trash'),
  44.             'parent_item_colon' => ''
  45.         ),
  46.         'public' => true,
  47.         'capability_type' => 'post',
  48.         'show_ui' => true,
  49.         'rewrite' => true,
  50.         'supports' => array( 'title', 'editor', 'comments', 'excerpt', 'custom-fields', 'thumbnail' ),
  51.         'taxonomies' => array( 'post_tag', 'category'),
  52.     ) );
  53.  
  54.     register_post_type( 've_members', array(
  55.         'labels' => array(
  56.             'name' => __( 'Our Members' ),
  57.             'singular_name' => __( 'Member' ),
  58.             'add_new' => _x('Add New', 've_members'),
  59.             'add_new_item' => __('Add a New Member'),
  60.             'edit_item' => __('Edit a Member'),
  61.             'new_item' => __('New Member'),
  62.             'view_item' => __('View a Member Profile'),
  63.             'search_items' => __('Search Members'),
  64.             'menu_icon' => $theme_dir . '/images/voodooTitleDefault.png',
  65.             'not_found' =>  __('No Members found'),
  66.             'not_found_in_trash' => __('No Member Profiles in Trash'),
  67.             'parent_item_colon' => ''
  68.         ),
  69.         'public' => true,
  70.         'capability_type' => 'post',
  71.         'show_ui' => true,
  72.         'rewrite' => true,
  73.         'heirarchical' => true,
  74.         'supports' => array( 'title', 'editor', 'comments', 'custom-fields', 'thumbnail' ),
  75.     ) );
  76.  
  77.     // Product taxonomy
  78.     register_taxonomy( 'product_category', 've_products', array( 'hierarchical' => true, 'label' => 'Product Category', 'query_var' => true, 'rewrite' => true ) );
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement