Include Custom Field in Search

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Include Custom Field in Search

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20851
    graphcom
    graphcom
    Participant

    Note this is our development site. The license for Ajax Search Pro is on the live site stewartmckelvey.com. I tested this under the licensed version, too and it’s not working.

    We have a search filter on this page (Find a Professional):
    https://peiwebsolutions.thedev.ca/stewartmckelvey2/our-team/

    The open search field (Name) is set to search a Custom Post Type Title and I’ve added a custom field ‘_nickname’ to be included in that field search. Used these instructions: https://documentation.ajaxsearchpro.com/general-settings/search-in-custom-fields

    However, the nickname field does not appear to be picking up.

    I didn’t disable other plugins since the search works great otherwise. That doesn’t appear to be a likely issue. No error log messages are generated.

    If you search for ‘charles’ or ‘harold’ you will get results. These are in the post titles. However, if you search for ‘chuck’ or ‘harry’, you get no results. These are in the nickname custom field.

    #20861
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much for all the details, I have found the problem. The issue was, that the custom field is not ‘_nickname’ but simply ‘nickname’: https://i.imgur.com/l4PAq8Z.png
    ACF usually creates two fields, one prefixed with ‘_’ for reference only.
    I have selected that field as well, and now if I try to search for a nickname, it seems to be returning the expected results now.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #20862
    graphcom
    graphcom
    Participant

    Well that was simple. I should have thought of that. Thanks so much. ASP is a great plugin BTW. I really like how customizable it is.

    Beth

    #20871
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.