Custom Fields
Support MB Views How to limit search to a specific category

  • Creator
  • #27148
    Resolved Henri


    In a MB view I want to add a search box that only searches posts in a specific category. Now I've managed to add the search box via


    Is there a way to add additional code in Twig to limit this function to search for posts of only a specific category? I've found php code, but I would like to add it in the MB view, so in Twig code.

    Kind regards, Henri

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #27161
    Long Nguyen

    Hi Henri,

    Twig is using for creating templates, so there are some limitations if you try to create some logical code like PHP. You can just create a PHP function then call it in the View to show the value.


    Thanks for answer. I was hoping not to have to write PHP 😉

    For now I've found a workaround with the plugin Ivory Search. That works for now using a sidebar.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.