Advertisement
marjwyatt

song_custom_posttype

Apr 19th, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php
  2. /** Register music custom post type */
  3. // Ref link: http://codex.wordpress.org/Function_Reference/register_post_type
  4.  
  5. function register_music_post_type() {
  6.     register_post_type( 'song',
  7.         array(
  8.             'labels' => array(
  9.                 'name' => __( 'Songs' ),
  10.                 'singular_name' => __( 'Song' ),
  11.                 'add_new' => __( 'Add New Song' ),
  12.                 'add_new_item' => __( 'Add New Song' ),
  13.                 'edit_item' => __( 'Edit Song' ),
  14.                 'new_item' => __( 'Add New Song' ),
  15.                 'view_item' => __( 'View Song' ),
  16.                 'search_items' => __( 'Search Songs' ),
  17.                 'not_found' => __( 'No songs found' ),
  18.                 'not_found_in_trash' => __( 'No songss found in trash' )
  19.             ),
  20.             'has_archive' => true,
  21.             'hierarchical' => true, //(activating this causes home page class to get lost)
  22.             'menu_position' => 5,
  23.             'menu_icon' => get_stylesheet_directory_uri() . '/images/speaker.png',  // Icon Path
  24.             'public' => true,
  25.             'feed' => true,
  26.             'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'comments', 'excerpt', 'trackbacks', 'custom-fields', 'genesis-seo' ),
  27.             'taxonomies' => array ('category','post_tag'),
  28.             'rewrite' => array( 'slug' => 'songs' ),
  29.             'register_meta_box_cb' => 'songs_meta'
  30.         )
  31.     );
  32.     flush_rewrite_rules( false );
  33. }
  34. add_action( 'init', 'register_music_post_type' );
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement