Community Forums › Forums › Archived Forums › Design Tips and Tricks › More Than One Custom Post Type
This topic is: not resolved
Tagged: Custom Post Type, genesis
- This topic has 1 reply, 2 voices, and was last updated 10 years, 3 months ago by Sridhar Katakam.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
January 21, 2014 at 7:05 pm #86375mechakoichiMember
I am trying to make multiple custom post types. I have been able to make one custom post type on top of the regular post type (regular posts & video posts), and would like to create additional custom post types. The problem is, when I try to create more than the one (videos) it won't load the page and everything is completely white.
This works (functions.php in child theme):
/** Add Custom Post Types */ add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'the_video', array( 'labels' => array( 'name' => __( 'Videos' ), 'singular_name' => __( 'Video' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'videos'), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-cpt-archives-settings' ), /*'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png', */ ) ); } add_post_type_support( 'the_video', 'genesis-layouts' );
But, when I add the other two it does not:
/** Add Custom Post Types */ add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'the_video', array( 'labels' => array( 'name' => __( 'Videos' ), 'singular_name' => __( 'Video' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'videos'), 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-cpt-archives-settings' ), /*'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png', */ ) ); } add_post_type_support( 'the_video', 'genesis-layouts' ); add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'the_place', array( 'labels' => array( 'name' => __( 'Places' ), 'singular_name' => __( 'Place' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'places'), 'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png', ) ); } add_post_type_support( 'the_place', 'genesis-layouts' ); add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'the_review', array( 'labels' => array( 'name' => __( 'Reviews' ), 'singular_name' => __( 'Review' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'reviews'), 'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png', ) ); } add_post_type_support( 'the_review', 'genesis-layouts' );
Does anyone know what I'm doing wrong? I'm using the Magazine Pro theme.
January 22, 2014 at 6:03 am #86425 -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.