Combine a keyword search with user’s choice of custom field values

Forums › Forums › Search & Filter Pro › Combine a keyword search with user’s choice of custom field values

Viewing 10 posts – 1 through 10 (of 22 total)
  • Anonymous
    #254232

    Hi

    I have a custom post type ‘xxxxxx’
    – each post has several ACF fields for displaying data

    The form and the initial view (of all XXXXX items) is set up on a custom template page

    The results go to the default search.php
    – where I separate out the XXXXX results from all other site’s results

    This works fine

    ——————

    I have now added a new ACF field ‘yyyyy-choice’
    – each xxxxxx cpt will have one of 10 choices
    choice one
    choice two
    choice three
    … etc…

    I now need to change this landing page to have a search/filter tool to combine two tasks.

    The visitor needs to find an item by keyword search from within a chosen selection of values from yyyyy-choice

    Possibly as a set of checkboxes underneath the main keyword search field
    – each checkbox represents one of the 10 values within yyyyy-choice
    – with a submit after this?

    ——————

    I would like search.php to then display all xxxx items that match those yyyyy-choice values

    i.e.
    search for ‘alexander’ within choice one … show 5 items
    or
    search for ‘alexander’ within choice one and choice four … show 10 items

    I have your Search & Filter Pro plugin
    – but I can’t seem to get this set up?

    If you could point me to a demo or information that I can work through

    Trevor
    #254272

    So, I expect to see a search form with the search text box and the options for that field, plus maybe a submit button. If this is a Post Meta field, I would expect it to be set like this:

    https://www.screencast.com/t/EqZ7jI4m

    Notice the Search Operator set to OR.

    If this does not work, are you able to send me a live link/URL to your search page so I can take a look?

    Anonymous
    #254276

    Hi Trevor

    I have screen grabs, links and a ZIP to help – but how do I get these to you?

    Trevor
    #254278

    Upload them to a file sharing site and share the links with me.

    Anonymous
    #254280
    This reply has been marked as private.
    Anonymous
    #254284
    This reply has been marked as private.
    Trevor
    #254332

    I see the error. In selecting the Meta Key name, note a ‘gotcha’ with ACF ….

    … it makes 3 meta keys per field, like this (in this example for a field named ‘land’):

    #1 _land
    #2 field_52f0fc4334f52
    #3 land

    In our Meta Key selection list, you need to use key #3, without the underscore at the start of the key name. If you choose #1 by mistake, in the field choices you will see the name of #2.

    Anonymous
    #254339
    This reply has been marked as private.
    Trevor
    #254341
    This reply has been marked as private.
    Anonymous
    #254343
    This reply has been marked as private.
Viewing 10 posts – 1 through 10 (of 22 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.