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/artwork/title-of-some-random-artwork. When I enter domain/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/artists/name-of-an-artist, I get an archive page with all the artwork from that artist. But when I only enter domain/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/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/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!
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/artwork/title-of-some-random-artwork. When I enter domain/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/artists/name-of-an-artist, I get an archive page with all the artwork from that artist. But when I only enter domain/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/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/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!
Share Improve this question edited Apr 6, 2020 at 5:48 HAL2020 asked Apr 6, 2020 at 5:37 HAL2020HAL2020 398 bronze badges 3 |1 Answer
Reset to default 0I solved it with this workaround. I created a new page ("Movies" with the URL domain/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/artists/some-artist-name, and an A-Z list of all artists on domain/artists
artists
) and run a customWP_Query
loop in the Page template. – Sally CJ Commented Apr 6, 2020 at 14:27