I have a custom page “fine-art”, which lists the different types of fine art that we produce based on the custom-taxonomy “fine_art_category”. Some of the custom taxonomies are wood, metal, Fine Art Editions/Album, Fine Art Editions/Metal.
The Fine Art Editions taxonomy doesn’t have anything in it, it only has subcategories Album and Metal.
Is it possible to create a slug for each of the custom taxonomies, so for example http://www.com/fine-art/wood and http://www.com/fine-art/metal. And in each page lists all of the posts with the custom taxonomy of wood. Or do I need to create a custom page for each category to make this happen?
This is my custom page for fine-art, which just lists the last five posts in each custom taxonomy.
<?php
/*
Template Name: Beta Fine Art
*/
$terms = get_terms("fine_art_category");
$count = count($terms);
if ( $count > 0 ){
foreach ( $terms as $term ) {
echo "<h3>" . $term->name . "</h3>";
$args = array(
'post_type' => 'fine-art',
'posts_per_page' => 5,
'tax_query' => array(
array(
'taxonomy' => 'fine_art_category',
'field' => 'slug',
'terms' => $term->slug
)
)
);
$wp_fineart_query = new WP_Query( $args );
while( $wp_fineart_query->have_posts() ) : $wp_fineart_query->the_post(); ?>
<h3><a href="https://wordpress.stackexchange.com/questions/50826/<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php
endwhile;
}
}
?>