Advertisement
Guest User

Untitled

a guest
May 6th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. //* Custom Post type code used inside the functions.php file inside the Executive Pro Genesis child theme.
  2. //* Create Portfolio Type custom taxonomy
  3. add_action( 'init', 'executive_type_taxonomy' );
  4. function executive_type_taxonomy() {
  5.  
  6. register_taxonomy( 'portfolio-type', 'portfolio',
  7. array(
  8. 'labels' => array(
  9. 'name' => _x( 'Types', 'taxonomy general name', 'executive' ),
  10. 'add_new_item' => __( 'Add New Portfolio Type', 'executive' ),
  11. 'new_item_name' => __( 'New Portfolio Type', 'executive' ),
  12. ),
  13. 'exclude_from_search' => true,
  14. 'has_archive' => true,
  15. 'hierarchical' => true,
  16. 'rewrite' => array( 'slug' => 'portfolio-type', 'with_front' => false ),
  17. 'show_ui' => true,
  18. 'show_tagcloud' => false,
  19. )
  20. );
  21.  
  22. }
  23.  
  24. //* Create portfolio custom post type
  25. add_action( 'init', 'executive_portfolio_post_type' );
  26. function executive_portfolio_post_type() {
  27.  
  28. register_post_type( 'portfolio',
  29. array(
  30. 'labels' => array(
  31. 'name' => __( 'Portfolio', 'executive' ),
  32. 'singular_name' => __( 'Portfolio', 'executive' ),
  33. ),
  34. 'has_archive' => true,
  35. 'hierarchical' => true,
  36. 'menu_icon' => get_stylesheet_directory_uri() . '/lib/icons/portfolio.png',
  37. 'public' => true,
  38. 'rewrite' => array( 'slug' => 'portfolio', 'with_front' => false ),
  39. 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-cpt-archives-settings' ),
  40. 'taxonomies' => array( 'portfolio-type' ),
  41.  
  42. )
  43. );
  44.  
  45. }
  46.  
  47. //* Add Portfolio Type Taxonomy to columns
  48. add_filter( 'manage_taxonomies_for_portfolio_columns', 'executive_portfolio_columns' );
  49. function executive_portfolio_columns( $taxonomies ) {
  50.  
  51. $taxonomies[] = 'portfolio-type';
  52. return $taxonomies;
  53.  
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement