Add wordpress custom post type

// Creates Game Reviews Custom Post Type
function game_reviews_init() {
    $args = array(
      'label' => 'Game Reviews',
        'public' => true,
        'show_ui' => true,
        'capability_type' => 'post',
        'hierarchical' => false,
        'rewrite' => array('slug' => 'game-reviews'),
        'query_var' => true,
        'menu_icon' => 'dashicons-video-alt',
        'supports' => array(
            'title',
            'editor',
            'excerpt',
            'trackbacks',
            'custom-fields',
            'comments',
            'revisions',
            'thumbnail',
            'author',
            'page-attributes',)
        );
    register_post_type( 'game-reviews', $args );
}
add_action( 'init', 'game_reviews_init' );

Leave a Reply

Your email address will not be published. Required fields are marked *