وردپرس

Only show those who has a tag?


Replies: 0

Hi!

I’m trying to build a searchable database for a hospital library, and I’ve encountered an issue with how categories and tags are being applied in the search results.

Here’s the situation:

  • When I conduct a search using the URL structure ?s=test&cat=6,46&tag=fakta, I am expecting the results to only show posts that match either category 6 or 46, while also having the “fakta” tag.
  • However, I am receiving posts that do not have the specified tag but do match one of the categories.

I would like to ensure that when a search is performed:

  1. Categories work as an “OR” condition, meaning the post can belong to any of the selected categories.
  2. Tags work as an “AND” condition, meaning the post must match at least one of the selected categories and the selected tag(s).

If this behavior isn’t default, could you guide me on how to configure Relevanssi to achieve this filtering logic?

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا