the story: I use wordpress to build my site with 3 categories "red", "green", "blue" and registered custom taxonomy "products" that includes some taxonomies like "pen" etc., I created a template "taxonomy-products.php" to display taxonomies of "products". The slug should be: www.mysite.com/products/pen.
I wanna add the categories to the taxonomy, it means when visit - for example - www.mysite.com/products/pen/red, the site will load "taxonomy-products.php" to display and query the pens in category "red"...
My inspiration - add something in "taxonomy-products.php" like:
<?php if ( "www.mysite.com/products/pen/" || "www.mysite.com/products/pen/red" ) : ?>
<?php locate_template( array( 'red.php' ), true ) ?>
<?php elseif ( "www.mysite.com/products/pen/blue" ) : ?>
<?php locate_template( array( 'blue.php' ), true ) ?>
<?php elseif ( "www.mysite.com/products/pen/green" ) : ?>
<?php locate_template( array( 'green.php' ), true ) ?>
<?php endif; ?>
In "red.php", "blue.php" and "green.php" will query corresponding pens ...
Can anybody help me to figure out the coding job? thanks in advance...