Advertisement
Guest User

Untitled

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