Skip to content

Instantly share code, notes, and snippets.

@richerimage
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save richerimage/a240749a54970353ee5f to your computer and use it in GitHub Desktop.

Select an option

Save richerimage/a240749a54970353ee5f to your computer and use it in GitHub Desktop.
Client Testimonial Taxonomy
// Register Custom Taxonomy
function testimonials_taxonomy() {
$labels = array(
'name' => _x( 'Sectors', 'Taxonomy General Name', 'thesis_dna' ),
'singular_name' => _x( 'Sector', 'Taxonomy Singular Name', 'thesis_dna' ),
'menu_name' => __( 'Sector', 'thesis_dna' ),
'all_items' => __( 'All Sectors', 'thesis_dna' ),
'parent_item' => __( 'Parent Sector', 'thesis_dna' ),
'parent_item_colon' => __( 'Parent Sector:', 'thesis_dna' ),
'new_item_name' => __( 'New Sector Name', 'thesis_dna' ),
'add_new_item' => __( 'Add New Sector', 'thesis_dna' ),
'edit_item' => __( 'Edit Sector', 'thesis_dna' ),
'update_item' => __( 'Update Sector', 'thesis_dna' ),
'separate_items_with_commas' => __( 'Separate Sectors with commas', 'thesis_dna' ),
'search_items' => __( 'Search Sectors', 'thesis_dna' ),
'add_or_remove_items' => __( 'Add or remove Sectors', 'thesis_dna' ),
'choose_from_most_used' => __( 'Choose from the most used Sector', 'thesis_dna' ),
'not_found' => __( 'Sector Not Found', 'thesis_dna' ),
);
$rewrite = array(
'slug' => 'sector',
'with_front' => true,
'hierarchical' => false,
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'rewrite' => $rewrite,
);
register_taxonomy( 'dna_sector', array( 'post', ' page', ' dna_tesimonials' ), $args );
}
// Hook into the 'init' action
add_action( 'init', 'testimonials_taxonomy', 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment