Archive page for CPT tags with rewrite URL
-
Hi everybody, i’ve been looking for an answer for days, i hope you can help me!
I created a custom post type, name ‘movie’ with rewrite => slug ‘films’.
I created a page with the slug ‘films’ so i can customize the page as i want and display the content of my CPT ‘movie’. It works fine.
I registered a tag taxonomy for the CPT, named ‘movie_tag’, width the slug ‘films/tags’. I can access my movie tag trough the url “xxx.com/films/tags/my_tag”.
I’d like to access a custom page, containing every tags (movie_tag) used with my CPT ‘movie’ and display them on this “archive” page, but i don’t know how.Here is my code, did i forgot something? I tried naming several pages like archive-movie_tag.php taxonomy-movie_tag.php, even archive.php and tag.php but each time i accessed “xxx.com/films/tags/” i went to the index.php.
register_taxonomy( 'movie_tag', 'movie', array( 'label' => 'Tags', 'labels' => array( 'name' => 'Tags', 'singular_name' => 'Tag', 'all_items' => 'Tous les tags', 'edit_item' => 'éditer le tag', 'view_item' => 'Voir le tag', 'update_item' => 'Mettre à jour le tag', 'add_new_item' => 'Ajouter un tag', 'new_item_name' => 'Nouveau tag', 'search_items' => 'Rechercher parmi les tag', 'popular_items' => 'Tags les plus utilisés' ), 'hierarchical' => false, 'has_archive' => false, 'capability_type' => 'page', 'public' => true, 'rewrite' => array( 'slug' => 'films/tags', 'with_front' => false, ), ) );
- The topic ‘Archive page for CPT tags with rewrite URL’ is closed to new replies.