Use the advanced search block with the custom fields in mode checkbox

  • CLAUDE
    CLAUDE
    Newbie 39 points
    April 13, 2015 at 8:40 am

    Initially, when submitting of the listing, I want to allow multiple choices so I create a custom field shaped checkbox.

    In a second step, on the homepage, I propose an advanced search bar for visitors with forms dropdown.

    But that just gives “array” …

    I walk around the problem by creating the hard choices …

    But it gives me bad results.

    How can I offers several choices of services then the creation of listing and have the possibility ( ->in my search bar wiyh dropdown) of getting correct results?

    The address of the site in question: Garde d’animaux

    Thank you for your help!

  • CLAUDE
    CLAUDE
    Newbie 39 points
    April 14, 2015 at 3:41 am

    Up !

    No idea for my problem ?

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    April 14, 2015 at 4:17 am

    WordPress will store checkbox or choice values as an array thus you cannot search them directly using the advanced search.

    ill work on this and try to come up with a solution for the next update.

  • CLAUDE
    CLAUDE
    Newbie 39 points
    April 20, 2015 at 10:30 am

    I am looking for a developer with a perfect mastery of the theme Directorypress responsive to help me achieve an adequate form my needs. I purchased a plugin of a member but it will change it. contact me on calinsmalins@free.fr

  • Alex Morgan
    Alex Morgan
    Super Guru 1,109 points
    April 20, 2015 at 11:23 am

    hi CLAUDE,

    I would suggest you post this on our jobs board: https://www.premiumpress.com/designwork/

  • James
    James
    Newbie 42 points
    April 20, 2015 at 1:18 pm

    Here is what I do and I think it achieves what you are describing.

    First, as you have done, set up a custom field as a check box with the options you need.

    Then in advanced search, set up a Search Field as Field Type = Select and Enter the exact Selection Box Values matching the options values as you have for the check boxes.

    Then set Data Stored as = text and Returned Values Must = (Like) Search Query..this last is the key part.

    I have attached an image of the setting from an older version of DP but the setting are the same as the current version.

    Check boxes store their results in a serialized format that looks like:

    a:3:{i:0;s:13:”Travel to You”;i:1;s:10:”Field Trip”;i:2;s:2:”–“;}

    The above search looks for the text in these fields that match the drop down selection in the advances search.

    Please let me know if this works for you.

    Jim

    Attachments:
    You must be logged in to view attached files.

  • Estela
    Newbie 4 points
    August 17, 2018 at 3:34 pm

    Thank you James. Your solution helps a lot.

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

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes