Advertisement
Guest User

custom post

a guest
Feb 13th, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.23 KB | None | 0 0
  1. <?php
  2. // Add new post type for News stories
  3.  
  4. function news_stories_init()
  5. {
  6.     $labels = array(
  7.         'name'               => _x( 'News', 'post type general name' ),
  8.         'singular_name'      => _x( 'News item', 'post type singular name' ),
  9.         'add_new'            => _x( 'Add New', 'news' ), /* menu label to add*/
  10.         'add_new_item'       => __( 'Adding news item' ), /* Heading of the blank add page*/
  11.         'edit_item'          => __( 'Editing news item' ), /* Heading when editing add page*/
  12.         'new_item'           => __( 'New news item' ),
  13.         'all_items'          => __( 'All News Items' ),
  14.         'view_item'          => __( 'View news story' ),
  15.         'search_items'       => __( 'Search News' ),
  16.         'not_found'          => __( 'No news found' ),
  17.         'not_found_in_trash' => __( 'No news items found in the Trash' ),
  18.         'parent_item_colon'  => '',
  19.         'menu_name'          => 'News'
  20.     );
  21.     $args = array(
  22.         'label' => __('News'),
  23.         'labels'        => $labels,
  24.         'description'   => 'Holds our news stories',
  25.         'public'        => true,
  26.         'menu_position' => 5,
  27.         'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),
  28.         'has_archive'   => true,
  29.     );
  30.     register_post_type('news',$args);
  31. }
  32.  
  33. add_action('init', 'news_stories_init');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement