Advertisement
Guest User

Untitled

a guest
Jun 14th, 2011
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.61 KB | None | 0 0
  1. <?php
  2.     if ( function_exists('register_sidebar') ) {
  3.         register_sidebar(array(
  4.             'name' => 'Sidebar',
  5.             'description' => 'Sidebar for the left side of the page.',
  6.             'before_widget' => '<li id="%1$s" class="widget %2$s">',
  7.             'after_widget' => '</li>',
  8.             'before_title' => '<h2 class="widgettitle">',
  9.             'after_title' => '</h2>',
  10.         ));
  11.     }
  12.    
  13.     add_action('init', 'class_type_register');
  14.     add_action('init', 'build_taxonomies');
  15.    
  16.     function build_taxonomies() {
  17.         register_taxonomy(
  18.             'classes',
  19.             'class_post',
  20.             array(
  21.                 'hierarchical' => true,
  22.                 'label' => 'Classes',
  23.                 'singular_name' => 'Class',
  24.                 'query_var' => true,
  25.                 'rewrite' => true
  26.             )
  27.         );
  28.     }
  29.    
  30.     function class_type_register() {
  31.     $labels = array(
  32.         'name' => _x('Class Posts', 'post type general name'),
  33.         'singular_name' => _x('Class Post', 'post type singular name'),
  34.         'add_new' => _x('Add New', 'class post'),
  35.         'add_new_item' => __('Add New Class Post'),
  36.         'edit_item' => __('Edit Class Post'),
  37.         'new_item' => __('New Class Post'),
  38.         'view_item' => __('View Class Post'),
  39.         'search_items' => __('Search Class Post'),
  40.         'not_found' =>  __('Nothing found'),
  41.         'not_found_in_trash' => __('Nothing found in Trash'),
  42.         'parent_item_colon' => ''
  43.     );
  44.     $args = array(
  45.         'labels' => $labels,
  46.         'public' => true,
  47.         'publicly_queryable' => true,
  48.         'show_ui' => true,
  49.         'query_var' => true,
  50.         'rewrite' => false,
  51.         'capability_type' => 'post',
  52.         'hierarchical' => false,
  53.         'menu_position' => null,
  54.         'supports' => array('title', 'editor', 'thumbnail', 'attachment')
  55.     );
  56.     register_post_type( 'class_post' , $args );
  57. }
  58.  
  59. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement