• 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!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Have you set your permalinks to this style ?

    Thread Starter mstdmstd

    (@mstdmstd)

    Seems no. Please, give ref how to do it.

    Login to your WordPress website administrator account.
    At Dashboard > Appearance > Permalinks, choose your desired style, click SAVE. This will create your .htaccess file.
    Now see how your links in menus etc are created.

    Thread Starter mstdmstd

    (@mstdmstd)

    Sorry, this needs for clarification.
    On this page I set Permalink Settings->Common Settings == “Post name”
    Optional parameters are empty.
    After this changes site with url
    http://local-wp-songs.com/artists_songs/a-boy-like-me-a-girl-like-you/

    works ok, where
    artists_songs – 2nd para,eter sent to register_taxonomy above.
    a-boy-like-me-a-girl-like-you – slug of an item

    But I would like to run page with 1 category(with all it’s posts) of created above category and I do not know how to make it.

    But I would like to run page with 1 category(with all it’s posts) of created above category and I do not know how to make it.

    You can make menu entries that do this, edit a menu and add an entry for your category of interest. (Remember to save the menu). Test this menu entry, it should give you a page listing posts in that category. NOW look at how that menu link is coded. Other links you make along the same lines will also work. Remove the menu entry if you no longer need it.

    Thread Starter mstdmstd

    (@mstdmstd)

    Thanks for your hints, I reviewed categories made in menu editor of backend and made working url like :
    http://local-wp-songs.com/artists_songs_tax/artists-songs-songs/
    where http://local-wp-songs.com – my host
    artists_songs_tax – name of registered taxonomy by function

    register_taxonomy( 'artists_songs_tax', array( 'artists_songs' ), $args );

    and artists-songs-songs – is slug field of my category in terms table.
    I have several categories created withy ‘artists_songs_tax’ taxonomy and they all are show with similar urls.

    But also If there is a way to show all categories of my taxonomy?

    urls like http://local-wp-songs.com/artists_songs_tax/ do not work for me….
    I want to show all posts all categories of my taxonomy someway…

    urls like http://local-wp-songs.com/artists_songs_tax/ do not work for me….
    I want to show all posts all categories of my taxonomy someway…

    How about creating a category “nearlyEverything”, that nearly all your posts belong to.

    Thread Starter mstdmstd

    (@mstdmstd)

    Please, explain how ?

    Create a category called “songs”
    Bring up each post and tick the category for “songs” and save
    Create a menu entry for category “songs”

    Thread Starter mstdmstd

    (@mstdmstd)

    Yes, as any post can be related with several categories, add and check some special category for all items. is it your idea?

    yes

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Correct url for categories’ is closed to new replies.