Skip to content

Instantly share code, notes, and snippets.

@hemusyl
Created August 28, 2016 07:59
Show Gist options
  • Save hemusyl/ea5d82c8fe847aba8f55529ac974f524 to your computer and use it in GitHub Desktop.
Save hemusyl/ea5d82c8fe847aba8f55529ac974f524 to your computer and use it in GitHub Desktop.
Taxonomy
<?php
function versiontwos_taxonomy() {
register_taxonomy(
'filter', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'portfolio', //post type name
array(
'hierarchical' => true,
'label' => 'Portfolio Category', //Display name
'query_var' => true,
'show_admin_column' => true,
'rewrite' => array(
'slug' => 'Portfolio-category', // This controls the base slug that will display before each term
'with_front' => true // Don't display the category base before
)
)
);
register_taxonomy(
'job_locationa', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'job', //post type name
array(
'hierarchical' => true,
'label' => 'Job Location', //Display name
'query_var' => true,
'show_admin_column' => true,
'rewrite' => array(
'slug' => 'Job-location', // This controls the base slug that will display before each term
'with_front' => true // Don't display the category base before
)
)
);
register_taxonomy(
'com-job', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'com-media', //post type name
array(
'hierarchical' => true,
'label' => 'Job', //Display name
'query_var' => true,
'show_admin_column' => true,
'rewrite' => array(
'slug' => 'Job ', // This controls the base slug that will display before each term
'with_front' => true // Don't display the category base before
)
)
);
}
add_action( 'init', 'versiontwos_taxonomy');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment