2

we have a situation where we want to build permalinks using mixed (unrelated, ie not hierarchical) taxonomies in permalinks on a wordpress site.

and we dont want the taxonomy name in the actual link.

So what we want is this:

example.com/residential/for_sale/sandton

where:

residential = cpt_property_type

for_sale = cpt_property_status

sandton = cpt_property_suburb

and then an archive of posts filtered by those criteria at each node.

Has anyone seen or done this before? We thought we'd find a plugin that would do it, but no luck yet. We've tried these plugins:

  • Custom Permalinks
  • Permalinks Customizer
  • Permalink Pro
  • Custom Post Type Permalinks

We though we'd need some kind of rule rewriting: (at least as start)

function custom_rewrite_rules() {
    add_rewrite_rule('^properties_type/(.*)/properties_status/(.*)?', 'index.php?properties_type=$matches[1]&properties_status=$matches[2]', 'top');
}

add_action('init', 'custom_rewrite_rules');

But that just sends us to the home page? Please can someone point us in the right direction :)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.