I've made a custom taxonomy named activities, containing items named local, member, and national:
<?php
function add_custom_taxonomies() {
register_taxonomy('Activities', 'post', array(
'has_archive' => true,
'hierarchical' => true,
'labels' => array(
// labels goes here
),
'rewrite' => array(
'slug' => 'activities',
'with_front' => true,
'hierarchical' => true
),
));
}
add_action( 'init', 'add_custom_taxonomies, 0 );
And I've created each taxonomy item a page, which are taxonomy-activities-local.php
, taxonomy-activities-member.php
, and taxonomy-activities-national.php
.
Accessing mydomain.com/activities/local/
is just fine. But accessing mydomain.com/activities/
itself redirects to a 404 page. I understand fully that this normally shouldn't work. It is just like accessing mydomain.com/tag/
, which also redirects to a 404 page.
Is there a way to use a template PHP file that I made? Hence, accessing mydomain.com/activities/
uses that PHP file instead of the 404 page without using any plugins?
activities
?