Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Ive created a custom post type and a custom taxonomy. I can create new posts and assign those taxonomies, but it returns a 404 when I go to mydomain.com/mycustomtaxonomy/termslug

Here is my code:

$labels = array(
        'name' => _x('Videos', 'post type general name'),
        'singular_name' => _x('Video', 'post type singular name'),
        'add_new' => _x('Nuevo', 'portfolio item'),
        'add_new_item' => __('Nuevo video'),
        'edit_item' => __('Editar video'),
        'new_item' => __('Nuevo video'),
        'view_item' => __('Ver videos'),
        'search_items' => __('Buscar videos'),
        'not_found' =>  __('Nothing found'),
        'not_found_in_trash' => __('Nothing found in Trash'),
        'parent_item_colon' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => true,
        'capability_type' => 'post',
        'rewrite' => array("slug" => "video"),
        'hierarchical' => true,
        'menu_position' => 5,
        'supports' => array('title', 'editor', 'thumbnail', 'page-attributes')
      ); 

    register_post_type( 'videos' , $args );
    flush_rewrite_rules();

    // Register custom taxonomy

    register_taxonomy("familia_videos", array("videos"), array("hierarchical" => true, "label" => "Categorias de Videos", "singular_label" => "Categoria de videos", 'rewrite' => true  ));

And my permalink structure:

/%postname%/

Ive created: taxonomy-familia_videos.php

Ive refreshed the permalinks structure, but I always get a 404.

Any help ?

Thanks

share|improve this question
add comment

1 Answer

but it returns a 404 when I go to mydomain.com/mycustomtaxonomy

The problem is that you're expecting behavior that simply doesn't exist. Just like mysite.com/category will 404, so will mysite.com/mycustomtaxonomy

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.