Guest User

Portfolio Taxonomy

a guest
Jun 30th, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.40 KB | None | 0 0
  1. // Portfolio Custom Post Type
  2. $labels = array(
  3.     'name' => _x('Portfolio', 'post type general name', 'site5framework'),
  4.     'singular_name' => _x('Portfolio', 'post type singular name', 'site5framework'),
  5.     'add_new' => _x('Add New', 'work', 'site5framework'),
  6.     'add_new_item' => __('Add New Portfolio', 'site5framework'),
  7.     'edit_item' => __('Edit Portfolio', 'site5framework'),
  8.     'new_item' => __('New Portfolio', 'site5framework'),
  9.     'view_item' => __('View Portfolio', 'site5framework'),
  10.     'search_items' => __('Search Portfolio', 'site5framework'),
  11.     'not_found' =>  __('No work found', 'site5framework'),
  12.     'not_found_in_trash' => __('No portfolio entry found in Trash', 'site5framework'),
  13.     'parent_item_colon' => ''
  14.   );
  15. register_post_type('portfolio', array(
  16.      'labels' => $labels,
  17.      'singular_label' => __('portfolio'),
  18.      'public' => true,
  19.      'show_ui' => true, // UI in admin panel
  20.      '_builtin' => false, // It's a custom post type, not built in!
  21.      '_edit_link' => 'post.php?post=%d',
  22.      'capability_type' => 'post',
  23.      'hierarchical' => false,
  24.      'rewrite' => array("slug" => "portfolio"), // Permalinks format
  25.      'supports' => array('title','editor','thumbnail')
  26. ));
  27.  
  28. register_taxonomy("portfoliocat", array("portfolio"), array("hierarchical" => true, "label" => "Portfolio Category", "singular_label" => "Portfolio Category", "rewrite" => true));
Advertisement
Add Comment
Please, Sign In to add comment