3
votes

I have a custom post type "certificates" & I have a custom taxonomy "certificate_category" that registered for "certificates" custom post type. here is my definition of taxonomy:

$args = array(
        'labels' => $labels,
        'hierarchical' => true,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' =>array( 'slug' => 'topics' )
    );
        register_taxonomy('certificate_category', 'certificates', $args);

This taxonomy has two terms with names "international" & "interior". I have created taxonomy.php for display "certificate_category" taxonomy (international & interior have same template).

The url for "internatonal" term is mysit/topics/international & for "interior" term is mysit.com/topics/interior and they both redirect to index.php.

What should I do to show taxonomy.php ?

1
Is the taxonomy registration code in the init hook? Have you visited the Settings/Permalinks section after you added the registration code in your functions.php? You can try disabling plugins / switching your theme just for troubleshooting. - steakoverflow
Yes it has a hook. What should I do with settings/permalinks? - mhnz
Just open Settings/Permalinks url, and then try opening the taxonomy term url. - steakoverflow
My problem is I have another custom post type and and another taxonomy that they work correctly with taxonomy.php , but taxonomy.php doesn't work for "certificate_category" taxonomy. Can you help me with this? - mhnz
Have you visited the Settings/Permalinks? I have created a site with your taxonomy registration code and it worked just fine with my taxonomy.php. - steakoverflow

1 Answers

0
votes

You shouldn't have to change any settings in the permalinks section, just visit it, then try opening /topics/international. The template you need is just taxonomy.php. I created a site with such configuration, and it worked on 1st try. Do you have any posts in any of the taxonomy terms?