This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem: User was having issues with categories images in translated pages Solution: There is probably a settings in the Categories Images Plugin that is used when returning categories images urls. Otherwise, you can hook into javascript and replace images src accordingly. This workaround is not good for SEO.

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by manfredS-14 5 months, 3 weeks ago.

Assigned support staff: Jamal.

Author Posts
May 1, 2019 at 7:54 am #3716727

manfredS-14

I am trying to: Change the image on the Arabic language

Link to a page where the issue can be seen: hidden link

I expected to see: The updated images

Instead, I got: The localhost URL of the image and it's not updating even after uploading a new image.

I have the same issue as https://wpml.org/forums/topic/upload-categories-image/

May 1, 2019 at 12:07 pm #3717841

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for contacting WPML Support. I will be glad to help with this.

Without more information on your current setup, I can only guess what causes this issue, can you please paste your WPML Debug information in the Debug information field?
- http://wpml.org/faq/provide-debug-information-faster-support/

Best regards,
Jamal
WPML Support

May 1, 2019 at 12:31 pm #3718077

manfredS-14

Here's the debug information.

May 1, 2019 at 2:32 pm #3718573

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for your feedback.
From what I can gather so far, I think that there is a setting in the Categories images plugin that is messing with the URLs and adding hidden link. As an example, an erroneous image has a source of
hidden link
When I changed it in the browser console to
hidden link
The images are shown correctly.

As a workaround, if you are comfortable with web development, you can add the following Javascript code to your website to correct this error for visitors. Search engines will still get erroneous images.

jQuery(function($){
    $('img').each(function(){
    	var img = $(this);
        var src = img.attr("src");
    	if ( /^http:\/\/localhost\/mercatoar/.test(src) ) {
    		img.attr("src", src.replace(/^http:\/\/localhost\/mercatoar/, '<em><u>hidden link</u></em>'));
    	}
    });
});

To resolve this issue, I would like to request access to your backend to further investigate it.

If you cannot, I can create a test server, where you install upload the plugin and your theme, if the issue is reproduced I can investigate there.
Looking forward to your reply.

Best regards,
Jamal
WPML Support

May 2, 2019 at 4:55 am #3721721

manfredS-14

My issue is resolved now. Thank you!