Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › show images on the multisite results page
- This topic has 7 replies, 2 voices, and was last updated 7 years, 3 months ago by
Ernest Marcinko.
-
AuthorPosts
-
February 14, 2019 at 2:17 pm #21114
alan
ParticipantI need you to show me the search images of the other sites just show me the images of the current site, is it possible to solve this? If you need more information about it please request.
February 14, 2019 at 3:49 pm #21124Ernest Marcinko
KeymasterHi,
It is a bit hard to answer, in some cases it might be possible. Generally multisite results pages are not capable of displaying results from across sites. There is a method in ajax search pro to basically force these results as ‘fake’ posts and change their URLs.
If you are somewhat familiar with theme coding, or already made changes to the theme files, then there is a theme function API available for the plugin. So if you can somehow locate the theme code where the images are printed, you could use this method (within the loop) to get the images parsed by Ajax Search Pro:
get_asp_result_field('image');..this returns the result image, if available. I am honestly not sure if this would work with any multisite environment though.
February 18, 2019 at 6:30 pm #21152alan
ParticipantYou cannot access this content.
February 19, 2019 at 10:45 am #21157Ernest Marcinko
KeymasterHi,
Your idea seems correct to me, to be honest, the code seems to be okay. However I am not sure where the ‘rh_no_thumb_url’ custom filter is executed, it might be out of the loop. It is also possible that the post data from the search is no longer available at that point, and then the function is not able to return it.
If you want, you can add temporary FTP details, and I can try to debug through the code, to see what exactly is happening.
February 19, 2019 at 11:51 am #21158alan
ParticipantYou cannot access this content.
February 19, 2019 at 2:39 pm #21174Ernest Marcinko
KeymasterHi,
Thank you!
I have added the following code to the functions.php file in the theme directory, I think it’s working now:
add_filter('rh_no_thumb_url', 'asp_custom_def_image'); function asp_custom_def_image($imagee){ $imagee = get_asp_result_field($field = 'image'); return $imagee; }February 19, 2019 at 4:17 pm #21180alan
ParticipantOhhh thank you! you’re the best
February 19, 2019 at 4:18 pm #21181Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.