Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* register "filter" taxonomy for "vendor* CPT */
- add_action( 'init', 'es_taxonomy_vendor_filter' );
- function es_taxonomy_vendor_filter() {
- register_taxonomy(
- 'filter',
- 'vendor',
- array(
- 'label' => __( 'Filter' ),
- 'rewrite' => array( 'slug' => 'filter' ),
- //'hierarchical' => true, // page style ##
- )
- );
- }
- /* register "location" taxonomy for "vendor* CPT */
- add_action( 'init', 'es_taxonomy_vendor_location' );
- function es_taxonomy_vendor_location() {
- register_taxonomy(
- 'location',
- 'vendor',
- array(
- 'label' => __( 'Location' ),
- 'rewrite' => array( 'slug' => 'location' )
- )
- );
- }
- // register "vendor" custom post type ##
- add_action( 'init', 'es_cpt_vendor' );
- function es_cpt_vendor() {
- $args = array(
- 'public' => true,
- 'label' => 'Vendors',
- 'hierarchical' => true, // page style ##
- 'supports' => array(
- 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'page-attributes'
- )
- );
- register_post_type( 'vendor', $args );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement