Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Problem to display an image with url in custom field
- This topic has 5 replies, 2 voices, and was last updated 7 years, 8 months ago by
Ernest Marcinko.
-
AuthorPosts
-
September 3, 2018 at 2:22 pm #19134
emirart
ParticipantHello !
I have an issue with the image option : the URL of the target image is stored in a custom field (“user-image-url”, it should be the image of a person) but the target picture is not displayed.
I configured the plugin with the choice “custom field” (see attachment 1) but, I don’t know why, the target image is not displayed and this is the default picture that is display instead (see attachment 2).
I tried to display the content of the field : this really is the URL of the photo that is stored (see attachment 3).So, I don’t understand why with the right information in the custom field, the picture is not displayed.
I use the version 4.13.4 of the plugin with the version 4.8.7 of WordPress.
Thank you in advance for your help.
MarieSeptember 3, 2018 at 2:57 pm #19139Ernest Marcinko
KeymasterHi!
May I ask what is the result type in this case? (post, page, custom post type, user etc..)
Can you please also add temporary FTP and back-end access, so I can debug the code if neccessary and take a look at your configuration. Thank you!
September 3, 2018 at 4:01 pm #19141emirart
ParticipantHi !
Yes, here a little more context : the page is a member directory, so it’s a user search.
There is only the search bar and the results suggestions in the page.
I followed your tutorial “staff research and filter” (https://wp-dreams.com/knowledge-base/demo-setup-staff-search-and-filter/) so the cards are results propositions I guess. It’s no clickable, just information.
Almost all the information is stored in custom fields and except for the picture I don’t have any other problem (see attachment 3 and 4).Other plugins installed : ACF Pro(almost all the site is based on this plugin), Cookie notice, Yoast SEO, Wordfence, GA, Export Users to CSV, Members, SVG Support.
Do you need other informations ?
For FTP and access information, I’m waiting for a validation from my clients, to know if they accept that I give you this information. I let you know when I have their answer.
But would you be able to give me some answers without that ?Thank you,
MarieSeptember 3, 2018 at 8:23 pm #19146Ernest Marcinko
KeymasterThank you.
That is the problem then. The custom field on image options only works with post meta, but not user metadata. I think however it might be possible to resolve without access, using a custom code.
I have made a custom snippet to try. Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!
This will parse the user meta from the image field, and change the image to it if available.
September 16, 2018 at 1:13 pm #19215emirart
ParticipantHello !
And sorry for the delay of my response.
Your solution works very well, thank you for your help !!Have a nice day,
MarieSeptember 17, 2018 at 10:10 am #19227Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Problem to display an image with url in custom field’ is closed to new replies.