Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › We lost the images in the search
This topic contains 8 replies, has 2 voices, and was last updated by Ernest Marcinko 6 years, 1 month ago.
- AuthorPosts
- August 10, 2017 at 10:33 pm #14220
Hi there,
we had some issues with other plugins and could solve it with a fresh .htaccess file.
But, from that point the images disappeared in the Ajax Search Pro plugin.
Can you please have a look?
Thank you so much,
KarstenAugust 11, 2017 at 3:57 pm #14241Hi Karsten,
From what I can see WordPress is returning the images with the wrong base URL, so instead of:
https://haushaltsfee.org/files/…..jpg
..it returns:
http://haushaltsblogs.de/files/…..jpg
If the site was recently moved from another domain, some data might still have the old url. To get around it, make sure to set these constants in the wp-config.php file (taken from WordPress.org tutirials):
define('WP_HOME','https://haushaltsfee.org'); define('WP_SITEURL','https://haushaltsfee.org');
If that does not work, then alternatively you can add this custom code to the functions.php file in your theme directory to replace the wrong image URLs:
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 11, 2017 at 5:00 pm #14242Hi Ernest,
both did not work 🙁
This was already in the config.php:
define(‘WP_HOME’,’https://haushaltsfee.org’);
define(‘WP_SITEURL’,’https://haushaltsfee.org’);And the addition of code in the functions.php made no difference.
But thanks for the hint regarding the base URL, I will ask my server admin.
I will let you now…
Thx,
KarstenAugust 11, 2017 at 5:12 pm #14243That is very weird. The custom code should do the trick no matter what. I might be missing something here. Your configuration is correct, everything looks to be all right there, so I don’t understand yet.
Feel free to add temporary FTP access as well, and I will try to debug through the code. It might be a bug I’m not aware of, I’m not sure to be honest.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 11, 2017 at 5:13 pm #14244Okay, I wait for the answer from my admin and come back to it then…
Thank you for your help!
August 11, 2017 at 6:42 pm #14245Hmm, my admin checked all the settings for the domain mapping and it should work.
Images on blog posts are on the right domain (.org):
https://haushaltsfee.org/files/2017/08/ausmisten-zimmer-vorher-nachher.jpgBut the plugin tries to find the images on .de?
Is there a chance to fix it with an entry in the .htaccess?
Thanks,
KarstenAugust 11, 2017 at 6:56 pm #14246In the meantime I did some investigation on the plugin, and I might have found the bug here. It happens when the image URLs are not sourcing from the main domain.
You will have to remove 3 lines from one of the plugin files:
– Open up: wp-content\plugins\ajax-search-pro\includes\classes\search\class-asp-search-cpt.php
– Scroll to lines 1685 – 1688, which should be this:if ( is_multisite() ) { $im = str_replace( home_url(), network_home_url(), $im ); }
– Remove these 3 lines from the code.
– Save the file.After that, the images should hopefully start showing up. Let me know if you need any help with this. If this solution works, I will incorporate it as a permanent fix in the next release of course.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 11, 2017 at 9:56 pm #14251Thank you Ernest, but still no luck with the pictures 🙁
August 14, 2017 at 11:34 am #14260Hm, I honestly don’t know what else could it be.
Again, if you want you can post temporary FTP access and I will try to debug through the search process to see how those images are parsed incorrectly.
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.