More Than One Custom Post Type

Community Forums Forums Design Tips and Tricks More Than One Custom Post Type

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Sridhar Katakam 6 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #86375

    mechakoichi
    Member

    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.

    #86425

    Sridhar Katakam
    Participant
    Post count: 923
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.