Multiple Custom Post Types?
-
Is it possible to have more than one custom post-type?
// Custom Post Types add_action( 'init', 'create_post_types' ); // Create New Post Type function create_post_types() { $labels = array( 'name' => __( 'Books' ), 'singular_name' => __( 'Book' ), 'add_new' => __( 'Add New Book' ), 'add_new_item' => __( 'Add New Book' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Book' ), 'new_item' => __( 'New Book' ), 'view' => __( 'View Book' ), 'view_item' => __( 'View Book' ), 'search_items' => __( 'Search Books' ), 'not_found' => __( 'No books found' ), 'not_found_in_trash' => __( 'No books found in Trash' ), 'parent' => __( 'Parent Book' ), ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 20, 'supports' => array('title','editor','thumbnail') ); register_post_type( 'books' , $args ); flush_rewrite_rules( false ); }
Every time I try and add additional post types to my current code, I get all kinds of error messages. Any ideas?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Multiple Custom Post Types?’ is closed to new replies.