Created
July 15, 2013 04:39
-
-
Save wpspeak/5997551 to your computer and use it in GitHub Desktop.
Create a Portfolio Post Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Create a Portfolio Post Type | |
add_action( 'init', 'register_cpt_portfolio' ); | |
function register_cpt_portfolio() { | |
$labels = array( | |
'name' => _x( 'Portfolio', 'portfolio' ), | |
'singular_name' => _x( 'Portfolio', 'portfolio' ), | |
'add_new' => _x( 'Add New', 'portfolio' ), | |
'add_new_item' => _x( 'Add New Portfolio', 'portfolio' ), | |
'edit_item' => _x( 'Edit Portfolio', 'portfolio' ), | |
'new_item' => _x( 'New Portfolio', 'portfolio' ), | |
'view_item' => _x( 'View Portfolio', 'portfolio' ), | |
'search_items' => _x( 'Search Portfolio', 'portfolio' ), | |
'not_found' => _x( 'No portfolio found', 'portfolio' ), | |
'not_found_in_trash' => _x( 'No portfolio found in Trash', 'portfolio' ), | |
'parent_item_colon' => _x( 'Parent Portfolio:', 'portfolio' ), | |
'menu_name' => _x( 'Portfolio', 'portfolio' ), | |
); | |
$args = array( | |
'labels' => $labels, | |
'hierarchical' => false, | |
'description' => 'Some of our works.', | |
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail' ), | |
'taxonomies' => array( 'Service' ), | |
'public' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'show_in_nav_menus' => true, | |
'publicly_queryable' => true, | |
'exclude_from_search' => false, | |
'has_archive' => true, | |
'query_var' => true, | |
'can_export' => true, | |
'rewrite' => true, | |
'capability_type' => 'post' | |
); | |
register_post_type( 'portfolio', $args ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment