Guest User

Untitled

a guest
Jul 27th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.29 KB | None | 0 0
  1. <?php
  2.  
  3. add_action('init', 'add_post_type');
  4. add_action( 'init', 'my_taxonomies_Programmering', 0 );
  5.  
  6. function add_post_type() {
  7.  
  8.     $labels = array(
  9.         'name' => _x('Programmering', 'post type general name'),
  10.         'singular_name' => _x('Programmering', 'post type singular name'),
  11.         'add_new' => _x('Add New', 'Programmering'),
  12.         'add_new_item' => __('Add New Programmering'),
  13.         'edit_item' => __('EditProgrammering'),
  14.         'new_item' => __('New Programmering'),
  15.         'view_item' => __('View Programmering'),
  16.         'search_items' => __('Search Programmering'),
  17.         'not_found' =>  __('Nothing found'),
  18.         'not_found_in_trash' => __('Nothing found in Trash'),
  19.         'parent_item_colon' => ''
  20.     );
  21.     $post_supports = array('title','editor','comments','thumbnail');
  22.     $args = array(
  23.         'labels' => $labels,
  24.         'public' => true,
  25.         'publicly_queryable' => true,
  26.         'show_ui' => true,
  27.         'query_var' => true,
  28.         'menu_icon' => get_stylesheet_directory_uri() . '/images/slider.png',
  29.         'rewrite' => true,
  30.         'capability_type' => 'post',
  31.         'hierarchical' => false,
  32.         'menu_position' => null,/*'taxonomies' => array('post_tag'),*/
  33.         'supports' => $post_supports,
  34.       );
  35.  
  36.     register_post_type( 'programmering' , $args );
  37. }
  38.  
  39. function my_taxonomies_Programmering() {
  40.     $labels = array(
  41.             'name'              => _x( 'Programmering Categories', 'taxonomy general name' ),
  42.             'singular_name'     => _x( 'Programmering Category', 'taxonomy singular name' ),
  43.             'search_items'      => __( 'Search Programmering Categories' ),
  44.             'all_items'         => __( 'All Programmering Categories' ),
  45.             'parent_item'       => __( 'Parent Programmering Category' ),
  46.             'parent_item_colon' => __( 'Parent Programmering Category:' ),
  47.             'edit_item'         => __( 'Edit Programmering Category' ),
  48.             'update_item'       => __( 'Update Programmering Category' ),
  49.             'add_new_item'      => __( 'Add New Programmering Category' ),
  50.             'new_item_name'     => __( 'New Programmering Category' ),
  51.             'menu_name'         => __( 'Programmering Categories' ),
  52.     );
  53.     $args = array(
  54.             'labels' => $labels,
  55.             'hierarchical' => true,
  56.     );
  57.     register_taxonomy( 'Programmering_category', 'programmering', $args );
  58. }
  59.  
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment