Support » Plugin: Relevanssi - A Better Search » Is there any way to limit the search to specific posts?

  • Is there any way to limit the search to specific posts?

    For example, I have a search form that is displayed on a user’s favorite posts page. I need this form to do the research taking into account only the posts that are favorited by the logged in user.

    It would be something like this
    ‘post_type’ => ‘post’,
    ‘s’ => $ keyword,
    ‘post__in’ => ‘1245, 2541, 3258, 325, 1258, 25’,

    it’s possible?

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Yes, Relevanssi supports post__in, but as you can see from the Codex, post__in cannot take a string parameter, it needs an array.

    'post__in' => array(1245, 2541, 3258, 325, 1258, 25),

    should work fine.

Viewing 1 replies (of 1 total)
  • The topic ‘Is there any way to limit the search to specific posts?’ is closed to new replies.