We lost the images in the search

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 Ernest Marcinko 6 years, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #14220
    Karsten Windfelder
    Karsten Windfelder
    Participant

    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,
    Karsten

    #14241
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi 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 :)


    #14242
    Karsten Windfelder
    Karsten Windfelder
    Participant

    Hi 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,
    Karsten

    #14243
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That 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 :)


    #14244
    Karsten Windfelder
    Karsten Windfelder
    Participant

    Okay, I wait for the answer from my admin and come back to it then…

    Thank you for your help!

    #14245
    Karsten Windfelder
    Karsten Windfelder
    Participant

    Hmm, 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.jpg

    But the plugin tries to find the images on .de?

    Is there a chance to fix it with an entry in the .htaccess?

    Thanks,
    Karsten

    #14246
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    In 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 :)


    #14251
    Karsten Windfelder
    Karsten Windfelder
    Participant

    Thank you Ernest, but still no luck with the pictures 🙁

    #14260
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hm, 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 :)


Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.