Skip to content

Instantly share code, notes, and snippets.

@wpspeak
Created May 13, 2014 19:23
Show Gist options
  • Save wpspeak/075aa1b465fec1e4edcc to your computer and use it in GitHub Desktop.
Save wpspeak/075aa1b465fec1e4edcc to your computer and use it in GitHub Desktop.
Portfolio Custom Post Type with Custom Icon
<?php
// Create portfolio custom post type
add_action( 'init', 'register_cpt_portfolio' );
function register_cpt_portfolio() {
register_post_type( 'portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio', 'portfolio' ),
'singular_name' => __( 'Portfolio', 'portfolio' ),
),
'menu_icon' => 'dashicons-star-filled',
'exclude_from_search' => true,
'has_archive' => true,
'hierarchical' => true,
'public' => true,
'rewrite' => array( 'slug' => 'portfolio' ),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment