• Resolved TickTockDesign

    (@ticktockdesign)


    Hi – I was wondering if there was a way to readily search meta data for custom posts. As far as I can tell, the dropdown displays the results of post titles, taxonomy titles, etc. – but not meta data.

    So, for instance, on a property website – I have a post type of Properties … and some meta data about their location. I was wondering if the drop down could display a property from a certain county, if that county info was part of the meta data?

    Does that sound viable?

    https://www.ads-software.com/extend/plugins/search-autocomplete/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Gabe Shackle

    (@hereswhatidid)

    Are you looking to have the meta field actually displayed in the results of the dropdown or just have them be searchable by the autocomplete?

    Thread Starter TickTockDesign

    (@ticktockdesign)

    To have content from the meta field displayed in the drop down, is what I was thinking.

    So if typing in the search box matches content in meta fields, that content is shown. I guess that’s beyond the scope of the plugin (which is fair enough!), I’m just wondering how I could go about customising that – or whether it’s not possible.

    Thanks.

    Plugin Author Gabe Shackle

    (@hereswhatidid)

    One way to insert that information would be to use the ‘search_autocomplete_modify_results’ filter. With that filter you can modify the final list of results being sent to the Autocomplete and then customize it to use the meta fields when applicable.

    More information on the filters can be found here:

    https://hereswhatidid.com/search-autocomplete/

    Thread Starter TickTockDesign

    (@ticktockdesign)

    hmmm … okay, that looks interesting. Thanks, I’ll check it out. Appreciate your prompt responses.

    I am not sure how to go about this, can anybody make it more clear for some of us? Which file do we put the filters in? Where do we put the request for our custom field?

    Thanks!

    Plugin Author Gabe Shackle

    (@hereswhatidid)

    This is a fairly advanced procedure that will require at least some basic knowledge of PHP and the WordPress theme and/or plugin methods. I would suggest starting here:

    https://codex.www.ads-software.com/Plugin_API

    Thank you. I do have “some” basic knowledge, but I guess it is beyond me without more instruction.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Searching meta data of custom posts’ is closed to new replies.