Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function create_portfolio_post_type() {
- register_post_type( 'portfolio',
- array(
- 'labels' => array(
- 'name' => _x( 'Portfolio', 'Portfolio post type general name', 'textdomain' ),
- 'singular_name' => _x( 'Portfolio Item', 'Portfolio post type singular name', 'textdomain' ),
- 'add_new' => _x( 'Add New', 'Portfolio post type', 'textdomain' ),
- 'add_new_item' => __( 'Add New Portfolio Item', 'textdomain' ),
- 'edit_item' => __( 'Edit Portfolio Item', 'textdomain' ),
- 'new_item' => __( 'New Portfolio Item', 'textdomain' ),
- 'view_item' => __( 'View Portfolio Item', 'textdomain' ),
- 'search_items' => __( 'Search Portfolio Items', 'textdomain' ),
- 'not_found' => __( 'No portfolio items found', 'textdomain' ),
- 'not_found_in_trash' => __( 'No portfolio items found in Trash', 'textdomain' ),
- 'parent_item_colon' => '',
- 'menu_name' => _x( 'Portfolio', 'Portfolio menu name', 'textdomain' ),
- ),
- 'public' => true,
- 'exclude_from_search' => true,
- 'has_archive' => true,
- 'supports' => array( 'title', 'editor', 'author', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),
- 'rewrite' => array( 'slug' => 'portfolio-items' )
- )
- );
- register_taxonomy( 'portfolio_category', 'portfolio',
- array(
- 'hierarchical' => true,
- 'labels' => array(
- 'name' => _x( 'Portfolio Categories', 'Portfolio taxonomy general name', 'textdomain' ),
- 'singular_name' => _x( 'Portfolio Category', 'Portfolio taxonomy singular name', 'textdomain' ),
- 'search_items' => __( 'Search Categories', 'textdomain' ),
- 'popular_items' => __( 'Popular Categories', 'textdomain' ),
- 'all_items' => __( 'All Categories', 'textdomain' ),
- 'parent_item' => null,
- 'parent_item_colon' => null,
- 'edit_item' => __( 'Edit Portfolio Category', 'textdomain' ),
- 'update_item' => __( 'Update Portfolio Category', 'textdomain' ),
- 'add_new_item' => __( 'Add New Portfolio Category', 'textdomain' ),
- 'new_item_name' => __( 'New Portfolio Category Name', 'textdomain' ),
- 'separate_items_with_commas' => __( 'Separate Portfolio category with commas', 'textdomain' ),
- 'add_or_remove_items' => __( 'Add or remove portfolio category', 'textdomain' ),
- 'choose_from_most_used' => __( 'Choose from the most used portfolio category', 'textdomain' ),
- 'not_found' => __( 'No categories found.', 'textdomain' ),
- 'menu_name' => __( 'Portfolio Categories', 'textdomain' ),
- ),
- 'show_ui' => true,
- 'query_var' => true,
- 'rewrite' => true,
- )
- );
- }
- add_action( 'init', 'create_portfolio_post_type' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement