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.

I don't quite understand how to link to my taxonomy templates. Do I need to make a page-tempalte and query my terms from there? I'm using the taxonomy hierarchy currently:

Taxonomy

$labels = array(
        'name'              => __( 'Product Categories' ),
        'singular_name'     => __( 'Product Category' ),
        'search_items'      => __( 'Search Product Categories' ),
        'all_items'         => __( 'All Product Categories' ),
        'parent_item'       => __( 'Parent Product Category' ),
        'parent_item_colon' => __( 'Parent Product Category:' ),
        'edit_item'         => __( 'Edit Product Category' ), 
        'update_item'       => __( 'Update Product Category' ),
        'add_new_item'      => __( 'Add New Product Category' ),
        'new_item_name'     => __( 'New Product Category' ),
        'menu_name'         => __( 'Product Categories' ),
    ); 
    $args = array(
        'labels'            => $labels,
        'show_in_nav_menus' =>  false,
        'hierarchical'      => true,
        'rewrite'           =>  array('slug' => '/products', 'with_front' => false),
    );
    register_taxonomy( 'protax', 'product', $args );

Then I have a taxonomy template : taxonomy-protax.php which I should be able to get to via www.mywebsite.com/products but it keeps leading to 404. Taxonomy template always seem to give me the most trouble... How do I view my taxonomy-protax.php page?

share|improve this question
    
"which I should be able to get to via www.mywebsite.com/products" No. You should be able to get a term archive with www.mywebsite.com/products/a-term, WordPress has no taxonomy archive, but term archives. –  G. M. Sep 23 '13 at 16:12
add comment

1 Answer

up vote 1 down vote accepted

According to the Codex:

taxonomy-{taxonomy}.php - If the taxonomy were sometax, WordPress would look for taxonomy-sometax.php

What I do when using custom taxonomy/custom post types is exactly what you mentioned in the second sentence. Make a page template and a page in the back end. Choose the template you built as the template to use when making your page.

Template Selector

EDIT

Just noticed that you're getting a 404. In that case, check your permalink structure as well.

Again, from the Codex:

If your site uses custom permalinks, you will need to flush your permalink structure after making changes to your taxonomies, or else you may see a "Page Not Found" error. Your permalink structure is automatically flushed when you visit Settings > Permalinks in your WordPress dashboard.

share|improve this answer
    
Right, I guess just because I have taxonomy doesn't mean WP will automatically create a url based on it, I would infact have to create a page for it. I guess it's not a huge deal but kind of inconvenient. –  Howdy_McGee Sep 23 '13 at 16:15
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.