Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Outputting custom field in search results?
This topic contains 15 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 1 month ago.
- AuthorPosts
- November 26, 2020 at 2:27 pm #30382
Hello!
I have a question that I hope you can help answer (and solve).
We are trying to output a logo (.png file) in the search results. So it outputs to the left of the search result heading.
The logo is a custom field within the user profile.
Is there a way to do this?
I hope you can help as it would make the results look super awesome! and would be a great feature.
Thank you
November 26, 2020 at 3:05 pm #30383Hi,
You can do it via the advanced title and content fields feature. For user type results, use that feature with the user fields here: https://i.imgur.com/aZiVb8c.png
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 27, 2020 at 12:58 pm #30402You cannot access this content.December 3, 2020 at 6:10 pm #30485Hi Ernest,
I have received back a message from my developer
“Unfortunately their suggestion won’t work. The logo is stored as an attachment to the user profile. So the image in the user profile is stored in the users database table as just an ID. The location of the image is stored in another database table. So to display the logo, we have to write some code that looks up the ID of the image in the users table and then searches the other table (using that ID as the reference) to find the URL of the image itself.
Their suggestion would only work for fields stored entirely in the users table.”
Do you know what sort of code could help pull this attachment in the profile?
Any help would be greatly appreciated
Thank you
(This is the main reason why I have purchased the support again, as we’d really like to get it to work)
December 4, 2020 at 1:06 pm #30488Hi,
The asp_results hook will help with that. It lets you make direct chagnes to each result field via a loop. I believe your developer will be able to work with that 🙂
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 21, 2020 at 4:42 pm #30852You cannot access this content.December 22, 2020 at 11:03 am #30867Well, that sounds like an easy job to me, but I can’t really give you any code besides the one I linked there. They just need to integrate their solution of getting the image by the user ID – which I assume is not too complicated based on the description – with the hook I linked. In that documentation there is a sample loop where all the most important result fields are explained.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 22, 2020 at 1:56 pm #30872You cannot access this content.December 22, 2020 at 2:00 pm #30873You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 22, 2020 at 4:42 pm #30877You cannot access this content.February 1, 2021 at 5:15 pm #31390You cannot access this content.February 2, 2021 at 10:38 am #31399Hi Martin!
The size of the images can be adjusted here: https://i.imgur.com/N7kB6wD.png
On the same panel you can also adjust the size and the count of the rows accordin to your needs: https://i.imgur.com/oryzFUo.png
If the row max width and the image width is close to each other, they will appear closer as well.Also, is it possible to have logos next to the headings, or is that unlikely?
Best,
I may need more details on this? Do you mean like the distance between the group heading and the logo? Adjusting the image width should help with that as well. If you get the width/height to the same ratio as the original image sizes, then the container will have less vertical/horizontal space as well.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 2, 2021 at 3:54 pm #31420You cannot access this content.February 3, 2021 at 3:15 pm #31437The number of rows is unfortunately same for each group – beacause the groups are not actually within a separated container, but the group headers are on the same level as the results, but it is set to span through all the rows. I am not sure if it is even possible without customization.
Best,
The other one definitely needs customization too. I can recommend the results templating feature (if I haven’t already).
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 7, 2021 at 11:15 pm #31492You cannot access this content. - AuthorPosts
You must be logged in to reply to this topic.