Created
September 19, 2019 15:32
-
-
Save hmbashar/8cc5322711a7b5084ba0c1106f893619 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
function shape_custom_post_taxonomy() { | |
register_taxonomy( | |
'testimonial_category', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces). | |
'shape-testimonial', //post type name | |
array( | |
'hierarchical' => true, | |
'label' => 'Categories', //Display name | |
'query_var' => true, | |
'show_admin_column' => true, | |
'rewrite' => array( | |
'slug' => 'testimonial-category', // This controls the base slug that will display before each term | |
'with_front' => true // Don't display the category base before | |
) | |
) | |
); | |
add_action( 'init', 'shape_custom_post_taxonomy'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment