最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Mixed unrelated taxonomy in permalink

programmeradmin8浏览0评论

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/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)

  1. 暂无评论