-
-
Save srikat/912bb965bdbc6766180d to your computer and use it in GitHub Desktop.
Portfolio related code in Executive Pro
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
//* 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', 'portfolio_columns' ); | |
function portfolio_columns( $taxonomies ) { | |
$taxonomies[] = 'portfolio-type'; | |
return $taxonomies; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment