Tags for custom post_type
-
On my website I’ve some post_type like: services, portfolio etc.
For post_type services I’ve a specific service-tags.
When I click on a first inserted tag-service, wordpress gave me a correct post. If I click any other services taxonomies wordpress respond with not found.
To insert service-tags I had put this code on file function.php//create two taxonomies, genres and tags for the post type "tag" function create_tag_taxonomies() { // Add new taxonomy, NOT hierarchical (like tags) $labels = array( 'name' => _x( 'Tags Servizi', 'taxonomy general name' ), 'singular_name' => _x( 'Tag Servizi', 'taxonomy singular name' ), 'search_items' => __( 'Search Tags Servizi' ), 'popular_items' => __( 'Popular Tags Servizi' ), 'all_items' => __( 'All Tags Servizi' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Tag Servizi' ), 'update_item' => __( 'Update Tag Servizi' ), 'add_new_item' => __( 'Add New Tag Servizi' ), 'new_item_name' => __( 'New Tag Name Servizi' ), 'separate_items_with_commas' => __( 'Separate tags Servizi with commas' ), 'add_or_remove_items' => __( 'Add or remove tags Servizi' ), 'choose_from_most_used' => __( 'Choose from the most used tags Servizi' ), 'menu_name' => __( 'Tags Servizi' ), ); register_taxonomy('tag-servizi','service',array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array( 'slug' => 'tag-servizi' ), )); }
- The topic ‘Tags for custom post_type’ is closed to new replies.