Correct url for categories
-
Hi all,
In WP 4.2 project I added taxonomy using register_taxonomy function like$labels = array( 'name'=> _x( 'Category Artists&Songs', 'Taxonomy General Name', 'artists_songs' ), 'singular_name'=>_x( 'Category of Artists&Songs', 'Taxonomy Singular Name', 'artists_songs' ), 'menu_name'=> __( 'Categories', 'artists_songs' ), 'all_items' => __( 'Categories', 'artists_songs' ), 'parent_item'=> __( 'Parent category', 'artists_songs' ), 'parent_item_colon' => __( 'Parent category:', 'artists_songs' ), 'new_item_name' => __( 'New category', 'artists_songs' ), 'add_new_item' => __( 'Add new category', 'artists_songs' ), 'edit_item' => __( 'Edit category', 'artists_songs' ), 'update_item' => __( 'Update category', 'artists_songs' ), 'search_items' => __( 'Search', 'artists_songs' ), 'add_or_remove_items' => __( 'Add or remove category', 'artists_songs' ), 'choose_from_most_used'=> __( 'Choose from most used', 'artists_songs' ), 'not_found'=> __( 'Not found', 'artists_songs' ), ); $args = array( 'labels' => $labels, 'hierarchical' => true, 'public' => true, ); register_taxonomy( 'artists_songs_tax', array( 'artists_songs' ), $args );and to this taxonomy I added several rows in wp_terms and wp_term_taxonomy tables like :
INSERT INTOwp_terms(term_id,name,slug,term_group`) VALUES
(1, ‘Uncategorized’, ‘uncategorized’, 0),
…
(96, ‘Artists&Songs songs’, ‘artists-songs-songs’, 0);INSERT INTO
wp_term_taxonomy(term_taxonomy_id,term_id,taxonomy,description,parent,count) VALUES
(1, 1, ‘category’, ”, 0, 1),
…
(109, 96, ‘artists_songs_tax’, ‘Songs Category for all posts describing songs’, 0, 5);
`
I can open page of Uncategorized categories with url
http://local-wp-songs.com/category/uncategorized/But I can not open pages of all my categories and any category with url like:
http://local-wp-songs.com/category/artists_songs/
http://local-wp-songs.com/category/artists-songs-songs/Which is the correct way for this ?
Thanks!
The topic ‘Correct url for categories’ is closed to new replies.