Remove base slug in CPT & CT, use CT in permalink

I copied your code as-is above, pasted it into the twentysixteen theme, and changed just the post type rewrite slug from review/%brand% to %brand%. This resulted in both the term archive and review posts having your desired URL structure and successfully displaying. Now the bad news is that the rewrite rules generated for the taxonomy … Read more

Many to Many Taxonomies or rewrite rules?

With reservations, sure, you can do what you want with this code: add_action(‘init’, ‘wpse_61376_rewrites’); function wpse_61376_rewrites() { add_rewrite_rule(‘^([^/]*)/([^/]*)/?$’,’index.php?category=$matches[1]&location=$matches[2]’,’top’); } Then go to Settings → Permalinks in wp-admin and click “Save Changes” to flush your rewrites and activate this rule. Reservations The problem about not having a prefix is that any permalink with two “sections” (site.com/section-1/section-2/) … Read more

Pros and cons of using [taxonomy name] in place of [category name]?

For the SEO part you might get better answers on the Pro Webmasters Stack Exchange. I will focus on the performance. From your example I assume your permalink structure was %category%/%postname%/. Because of the way WordPress parses the incoming URL, this will result in verbose page rules, which means that each page (not post) you … Read more

Pages, Custom Posts & Custom Taxonomy defining slug structure

All of the cases you describe are handled by the post type archive, post type single, and taxonomy term archive pages that are all automatically generated (depending on arguments) when you register your post type and taxonomy. function wpd_add_custom_types() { // register fruit post type $args = array( ‘public’ => true, ‘label’ => ‘Fruit’, ‘has_archive’ … Read more

Taxonomy query for children of parents

Use get_queried_object() to get the current queried term on a category page: $this_term = get_queried_object(); $args = array( ‘parent’ => $this_term->term_id, ‘orderby’ => ‘slug’, ‘hide_empty’ => false ); $child_terms = get_terms( $this_term->taxonomy, $args ); echo ‘<ul>’; foreach ($child_terms as $term) { echo ‘<li><h3><a href=”‘ . get_term_link( $term->name, $this_term->taxonomy ) . ‘”>’ . $term->name . ‘</h3></a></li>’; … Read more