Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /** Register music custom post type */
- // Ref link: http://codex.wordpress.org/Function_Reference/register_post_type
- function register_music_post_type() {
- register_post_type( 'song',
- array(
- 'labels' => array(
- 'name' => __( 'Songs' ),
- 'singular_name' => __( 'Song' ),
- 'add_new' => __( 'Add New Song' ),
- 'add_new_item' => __( 'Add New Song' ),
- 'edit_item' => __( 'Edit Song' ),
- 'new_item' => __( 'Add New Song' ),
- 'view_item' => __( 'View Song' ),
- 'search_items' => __( 'Search Songs' ),
- 'not_found' => __( 'No songs found' ),
- 'not_found_in_trash' => __( 'No songss found in trash' )
- ),
- 'has_archive' => true,
- 'hierarchical' => true, //(activating this causes home page class to get lost)
- 'menu_position' => 5,
- 'menu_icon' => get_stylesheet_directory_uri() . '/images/speaker.png', // Icon Path
- 'public' => true,
- 'feed' => true,
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'comments', 'excerpt', 'trackbacks', 'custom-fields', 'genesis-seo' ),
- 'taxonomies' => array ('category','post_tag'),
- 'rewrite' => array( 'slug' => 'songs' ),
- 'register_meta_box_cb' => 'songs_meta'
- )
- );
- flush_rewrite_rules( false );
- }
- add_action( 'init', 'register_music_post_type' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement