Created
February 15, 2022 06:47
-
-
Save faaezahmd/2dc0c99e2812789ae540a05f15a90dbf to your computer and use it in GitHub Desktop.
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
// Lets us create Taxonomy for Custom Post Type | |
add_action( 'init', 'jobs_custom_taxonomy', 0 ); | |
//create a custom taxonomy name it "type" for your posts | |
function jobs_custom_taxonomy() { | |
$labels = array( | |
'name' => _x( 'Types', 'taxonomy general name' ), | |
'singular_name' => _x( 'Type', 'taxonomy singular name' ), | |
'search_items' => __( 'Search Types' ), | |
'all_items' => __( 'All Types' ), | |
'parent_item' => __( 'Parent Type' ), | |
'parent_item_colon' => __( 'Parent Type:' ), | |
'edit_item' => __( 'Edit Type' ), | |
'update_item' => __( 'Update Type' ), | |
'add_new_item' => __( 'Add New Type' ), | |
'new_item_name' => __( 'New Type Name' ), | |
'menu_name' => __( 'Types' ), | |
); | |
register_taxonomy('types',array('jobs'), array( | |
'hierarchical' => true, | |
'labels' => $labels, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'job' ), | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment