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

taxonomy - Filtering multiple categories via the URL

programmeradmin2浏览0评论

Is it possible to filter multiple categories via a URL?

Basically I have two sections to the site, let's call them fruits and vegetables.

I have a list of categories which applies to both of these, let's call them red and orange.

So my category structure looks like this:

  • type
    • fruits
    • vegetables
  • color
    • red
    • orange

So if I made a post called "Carrot", I'd assign it to "vegetables" and "orange"

What I'm trying to make is custom category pages for fruits and vegetables. The user will see the color categories listed in the sidebar, but if they are on the vegetables category page and click "orange" from the sidebar, they should only see posts that are in vegetables AND orange.

I was really hoping there'd be a way to do this with the URL. I tried:

example/?cat=id-3+id-21

but this shows posts that are in vegetables OR oranges, which is no good.

Is there a way to do this via the URL? Or is this going to require a custom query?

发布评论

评论列表(0)

  1. 暂无评论