problem on searching inside custom fields

Home Forums Product Support Forums Ajax Search Pro for WordPress Support problem on searching inside custom fields

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 8 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #8788

    Hi all, i’ve purchased this great plugin, but i have some problem about it,

    my situation: i have some custom post type, like portfolios – aree – opere – autori.

    every single portfolios item can has one or more aree or autori associated to it.
    for example inside musei vaticani there is cappella sistina (area strutturale), or autore (michelangelo buonarroti).

    in the homepage i need to show only the portfolio item, but i would the plugin can search inside the custom field, so if i write cappella sistina it will show only the musei vaticani.

    how can i do that? i’ve tried a lot wihout any results.

    Ernest Marcinko
    Ernest Marcinko


    Thank you for the details and kind words!

    I’ve looked through the setup, and the problem is that those custom fields does not actually store the author name, only a reference ID (relationship) to it – because it’s a complex ACF custom field, not text based. The actual author name is stored somewhere else, most likely in the options table in the database or somewhere in ACF internally. This means, that it’s impossible to search through, as the actual data is not visible for Ajax Search Pro in the options meta database table.

    If there was a quick code based solution, I would gladly look into it, but in this case there is nothing I can do to make those fields data available for the search query.

    In these cases I usually recommend 2 possible solutions:
    1. creating a simple custom field on the post editor, for example with the name “search_keywords” and writing every extra required information there – like author name, tags, places etc..
    2. ..or to enter the additional information as post tags, however solution 1. is more transparent, as it’s not visible to the user.
    Then on the search options select to search the “search_keywords” custom field as well, and done.

    Ernest Marcinko

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

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

You must be logged in to reply to this topic.