Question

I used the "Custom Post Types UI" and "Custom Fields" plug-ins to set up my structure.

I have a custom post type called "artwork". This works fine. Posts have URLs like domain.cc/artwork/title-of-some-random-artwork. When I enter domain.cc/artwork, I get an archive page with all posts of the post type "artwork". That's how it should be.

Within the "Artwork" post type, I have taxonomies for "Artist", "Movie" and "Company" (connected to custom fields which can be filled in when I entered a new movie, a new artist or a new company). When I enter domain.cc/artists/name-of-an-artist, I get an archive page with all the artwork from that artist. But when I only enter domain.cc/artists, I get a 404 error. Instead, I would like to get a page with a list of all artist entries from the "artists" taxonomy.

Same problem with the "Movie" taxonomy: When I enter domain.cc/movies/some-movie-title, I get an archive page with all the artworks from that movie. Again, everything fine. But when I only enter domain.cc/movies, I get a 404 error. Instead, I would like to get a list of all movie title entries from the "movies" taxonomy.

I googled for hours, but couldn't find a solution.

Thank you for your help!

Was it helpful?

Solution

I solved it with this workaround. I created a new page ("Movies" with the URL domain.cc/movies) and added this via shortcode:

<?php
     $taxonomy = 'artists';
     $tax_terms = get_terms( $taxonomy, array(
    'post_type' => 'artwork',
    'orderby' => 'name',
    'order' => 'ASC' 
     ) );
 ?>
 <?php
     foreach ($tax_terms as $tax_term) {
 ?><div class="artistslist">
     <a href="/<?php echo $taxonomy;?>/<?php echo $tax_term->slug;?>"><?php echo $tax_term->name;?>
     </div>
 <?php } ?>

Now I can access artist archives via domain.cc/artists/some-artist-name, and an A-Z list of all artists on domain.cc/artists

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top