Skip to content

Instantly share code, notes, and snippets.

@srikat
Created January 23, 2014 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/912bb965bdbc6766180d to your computer and use it in GitHub Desktop.
Save srikat/912bb965bdbc6766180d to your computer and use it in GitHub Desktop.
Portfolio related code in Executive Pro
//* 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