Forums Forums Search & Filter Pro Search custom fields via S&F

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #54317

    Hi, I mentioned this issue on another thread but figured I’d start my own. I’m a little confused on how this works.

    From my understanding I can only have 1 “search” field on S&F. I would like two search fields to search through separate custom field keys (Not ACF fields, just regular custom fields). The fields are “First name” and “Last name”.

    I kinda understand I need to have two different search fields on ACF and then integrate that into S&F. I understand how to place the fields on the page…but not sure how to integrate it into the query to display results on results.php. Is this done in a .php file in S&F? If so, which file would that be?

    Much thanks.

    Trevor
    #54318

    Hi

    You can have only one general ‘search’ field per form, as you say. It can search across the custom fields when you use Relevanssi.

    If you are using the shortcode method, S&F uses it own results.php template; for other display methods the theme templates are used, so you would have to edit them.

    The documentation shows how to set up and use a customizable results.php template:

    https://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/#Customising_the_Results

    Anonymous
    #54325

    Okay, I will live with one search field.

    Is there any way to make my search only search through ONE custom field key? As it is now with Relevanssi it searches through values of all the custom field keys.

    Trevor
    #54337

    You can nominate the one field instead of putting all in you can name the field in Relevanssi settings.

    Anonymous
    #54425

    Got it. What if I have a search on a different page that I want to search through different keys with?

    Trevor
    #54430

    It should still work.

Viewing 6 posts - 1 through 6 (of 6 total)