currently building a custom magazine site and running into some rewrite issues.
I'm using the default Posts post type, and have added in a custom Taxonomy for Issues (issue_cats). Everything works great for the most part but I'm struggling to get the permalinks structured correctly. I'm also using the default "Categories" as well for general categories for the articles.
In case it matters, I also have a page with a slug 'issues' that is simply a page with custom page template displaying a custom layout of terms in the issue_cats taxonomy.
The link structure to view all Issues is: site.com/issues/
The link structure looks like this for individual Issues: site.com/issues/issue-name and works like a treat.
The problem is with the single posts. The URLs ideally should be: site.com/issues/issue-name/post-name.
Have tried a couple of things and in some cases got the single posts to work/have the correct slug, but it causes all regular pages on the site to return 404's. Googled for days, and thought I found a solution at one point, but it doesn't work as of 4.5.2 apparently. Any thoughts?
Here is my custom Issue Taxonomy code:
function zbt_register_custom_tax() {
$labels = array(
'name' => 'Issue',
'singular_name' => 'Issue',
'search_items' => 'Search Issues',
'all_items' => 'All Issues',
'parent_item' => 'Parent Issue',
'parent_item_colon' => 'Parent Issue',
'edit_item' => 'Edit Issue',
'update_item' => 'Update Issue',
'add_new_item' => 'Add Issue',
'new_item_name' => 'New Issue',
'menu_name' => 'Issues'
);
$args = array(
'labels' => $labels,
'show_admin_column' => true,
'hierarchical' => true,
'rewrite' => array( 'slug' => 'issues', 'with_front' => false ),
'show_ui' => true,
'query_var' => true,
'public' => true,
);
register_taxonomy( 'issue_cats', 'post', $args );
}
add_action( 'init', 'zbt_register_custom_tax', 99 );