Creates a new content type, for example “Portfolio”.
How to use: Add it to functions.php (or better, a small plugin so it survives theme changes). Then go to Settings → Permalinks → Save to flush rewrite rules.
function my_register_portfolio() {
register_post_type( 'portfolio', array(
'labels' => array(
'name' => 'Portfolio',
'singular_name' => 'Project',
),
'public' => true,
'has_archive' => true,
'menu_icon' => 'dashicons-portfolio',
'supports' => array( 'title', 'editor', 'thumbnail' ),
'show_in_rest' => true,
) );
}
add_action( 'init', 'my_register_portfolio' );
Tested on
WordPress 6.8
Reported by the author on October 10, 2026. WPFolks has not verified this.
Not tested against WordPress 7.1.3. It may still work.