Custom Post Type for Portfolio

Create a custom post type for a portfolio.

<?php
function create_portfolio_post_type() {
    register_post_type('portfolio',
        array(
            'labels'      => array(
                'name'          => __('Portfolios'),
                'singular_name' => __('Portfolio'),
            ),
            'public'      => true,
            'has_archive' => true,
            'supports'    => array('title', 'editor', 'thumbnail'),
            'rewrite'     => array('slug' => 'portfolio'),
            'menu_icon'   => 'dashicons-portfolio',
        )
    );
}
add_action('init', 'create_portfolio_post_type');
?>

Post Comment