Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Custom field data is not displayed in search
This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko 3 months ago.
- AuthorPosts
- November 8, 2022 at 4:10 pm #39914
Hello, I have some trouble with advanced custom fields not showing the data in the search results.
Basically I want to use the plugin for searching for staff members. I order to easily translate the fields with WPML, I have two custom fields i want to use:
team_phone and team_email.I use Avada theme, and the staff members are added as FAQ items (as a workaround).
You can have a look at Alexander here where i have added data for phone and email fields. They display fine on the frontend, but in the search bar the field display as “Your content goes here”.
Hope you can have a look, thanks.
Attachments:
You must be logged in to view attached files.November 9, 2022 at 10:58 am #39932Hi,
Thank you very much for the details, it helps us a lot!
This is a very intereting issue. I logged in and tried a few different things, and it turns out when the plugin requests the post content, this text is actually returned. I have made a few changes too to see if using different methods would work, but every single time this is returned as the actual post content.
My guess is, that the fusion builder may work differently during the actual page request and within the ajax request. To save resources developers tend not to initialize parts of their plugins during XHR requests (to make it faster), and I believe this is exactly what is happening here. Basically some parts of the fusion builder are not hooked up, so it does not execute the content filters and simply the default text is returned when requested.
I tried to look up their documentation if there is any way to explicitly force the page builder to initialize as in normal requests, but I found nothing. I also looked up all option, no luck either. I am almost certain this is a bug in their plugin, I highly doubt this was intended to work this way.
My best advice here is to use the advanced title and content fields feature. That allows you adding custom fields contents to the live results list, so you can replicate the fusion builder output to some extent.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2022 at 11:39 am #39934Thanks for the reply and looking into it. It works perfect now with the content fields solution you linked to.
I have another question now, is it possible to remove the link on the search result? All the info the user need for the employee is displayed in the search bar, so there’s no need to link to the employee page.Thanks.
November 9, 2022 at 2:01 pm #39936Hi,
Sure – the best way to do that is via a custom code:
Best,.asp_r .item, .asp_r .item a { pointer-events: none; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2022 at 2:56 pm #39939That works great, thank you.
I have a problem with the search results now. I’ve attached some screenshots, the problem is this:
1. I’ve made the design like this: search bar on left, and empty results box on right.
2. Searching for someone, the results display in the right box.
3. Now the problem is, if i delete what I just searched for, 3 random results will appear in the results box. How can I get rid of this, I just want it to be empty like on step 1.Attachments:
You must be logged in to view attached files.November 9, 2022 at 3:30 pm #39943You can change that by increasing the number of characters to trigger the search to 1 or more here: https://i.imgur.com/OwFLavM.png
Best,
That will do the trick.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 9, 2022 at 3:35 pm #39944That did it, perfect, thank you!
November 9, 2022 at 3:37 pm #39945You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.