Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //* Custom Post type code used inside the functions.php file inside the Executive Pro Genesis child theme.
- //* Create Portfolio Type custom taxonomy
- add_action( 'init', 'executive_type_taxonomy' );
- function executive_type_taxonomy() {
- register_taxonomy( 'portfolio-type', 'portfolio',
- array(
- 'labels' => array(
- 'name' => _x( 'Types', 'taxonomy general name', 'executive' ),
- 'add_new_item' => __( 'Add New Portfolio Type', 'executive' ),
- 'new_item_name' => __( 'New Portfolio Type', 'executive' ),
- ),
- 'exclude_from_search' => true,
- 'has_archive' => true,
- 'hierarchical' => true,
- 'rewrite' => array( 'slug' => 'portfolio-type', 'with_front' => false ),
- 'show_ui' => true,
- 'show_tagcloud' => false,
- )
- );
- }
- //* Create portfolio custom post type
- add_action( 'init', 'executive_portfolio_post_type' );
- function executive_portfolio_post_type() {
- register_post_type( 'portfolio',
- array(
- 'labels' => array(
- 'name' => __( 'Portfolio', 'executive' ),
- 'singular_name' => __( 'Portfolio', 'executive' ),
- ),
- 'has_archive' => true,
- 'hierarchical' => true,
- 'menu_icon' => get_stylesheet_directory_uri() . '/lib/icons/portfolio.png',
- 'public' => true,
- 'rewrite' => array( 'slug' => 'portfolio', 'with_front' => false ),
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-cpt-archives-settings' ),
- 'taxonomies' => array( 'portfolio-type' ),
- )
- );
- }
- //* Add Portfolio Type Taxonomy to columns
- add_filter( 'manage_taxonomies_for_portfolio_columns', 'executive_portfolio_columns' );
- function executive_portfolio_columns( $taxonomies ) {
- $taxonomies[] = 'portfolio-type';
- return $taxonomies;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement