Forums

Custom post type and taxonomy permalinks (1 post)

  1. digitaldeath
    Member
    Posted 6 months ago #

    Hi all,
    I have a custom post type, “Projects” and a custom taxonomy called “Status” with the terms “Active” and “Inactive”. I can hit /projects/status/active/ and /projects/status/inactive/ after I create taxonomy-status-active.php and taxonomy-status-inactive.php and I get the expected results as each template queries the respective term (active or inactive). However, what if I have a custom taxonomy called “Years”? I know I could create for example, taxonomy-years.php (doesn't seem to work for me), but what if I have a lot of projects per page, and want to pull back all projects for the year 2001, surely I can’t create a custom template for each year? Could I just get the year from the URL and pass that as the query var to WP_query eg. /projects/years/2001/ and somehow create a “general” template for when someone queries /projects/years/2001/ ?
    And finally, I can hit /projects/status/active/ no problem, but /projects/status/ 404s. What do I’ve to do to get a page that automatically queries all terms within the taxonomy in the URL ie. /projects/status/

    Thanks in advance.

Reply

You must log in to post.

About this Topic