WordPress.org

Ready to get started?Download WordPress

Forums

Only one of my custom taxonomy archive page get 404 error (4 posts)

  1. TC.K
    Member
    Posted 2 years ago #

    I created 3 custom taxonomy for a custom post type - state, city, and selling_type. I also created taxonomy-state.php, city-taxonomy.php and taxonomy-selling_type.php to be the archive page.

    Oddly, the taxonomy-state.php and taxonomy-selling_type.php are working, but only the city-taxonomy.php give 404 error.

    I use the same method to create and registered the taxonomies. I don't what's wrong with the "city". The only differences between city and state/selling_type is, in the custom type, the city is using text input whereas state/selling_type is using dropdown to insert terms.

  2. tenten71
    Member
    Posted 2 years ago #

    It should be just a matter of editing your file name to be 'taxonomy-city.php'. That is how WordPress explains it.

    SIDE NOTE: An issue I had was creating a taxonomy called 'license'. For some reason, changing it to 'licenses' made it work. Might have been a core term already used by WP.

  3. TC.K
    Member
    Posted 2 years ago #

    Well, I just find out that was a typo in my question. I created taxonomy-city.php, which is not working in my wp.

    I found that their is a .xml generated in the permalink. It is not showed in the browser address bar, but I can see it in the error message:

    Not Found
    The requested URL /example/<strong>city.xml</strong>/new-york/ was not found on this server.

    If I change the the rewrite rule to false, the problem solve.

  4. tenten71
    Member
    Posted 2 years ago #

    I don't know if the forum is adding the 'strong' tags, but I know in my recent experience I had to go to to the Permalinks settings and just hit the save button to fix these things.

    I believe you want rewrite to be true. I actually have them like this:
    'rewrite' => array('slug' => 'licenses')

Topic Closed

This topic has been closed to new replies.

About this Topic