Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Asia/Singapore (GMT+08:00)

Tagged: 

This topic contains 0 replies, has 0 voices.

Last updated by Kor 20 hours, 51 minutes ago.

Assisted by: Kor.

Author Posts
February 22, 2025 at 7:31 am #16735814

anttiH-4

Background of the issue:
I am trying to display the Woocommerce Category Header Image on translated pages using the Salient Theme. The image is not automatically copied to translated languages. Image can not be added manually either. The issue can be seen on this page: hidden link

Symptoms:
The Category Header Image is not displayed for translated languages. I expected to see the same image for translated pages, but instead, the image is not displayed.

Questions:
Why is the Category Header Image not automatically copied to translated pages?
How can I ensure the image is displayed on all translated pages without manual intervention?

February 24, 2025 at 4:24 am #16738915

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for contacting us.

I can see the missing header category image here hidden link .

I would need to check the setup and I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.

Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.

Your upcoming reply will be treated with confidentiality and will only be visible to you and me.

✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.

Also, we have released some updates for our WPML plugin and please backup and update.

February 25, 2025 at 7:41 am #16744139

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. I can see the plugins not updated yet hidden link . Could you please backup and update it? Then, run the troubleshooting options here hidden link and see if it helps.

February 25, 2025 at 3:13 pm #16746677

anttiH-4

Hi,

I updated all plugins. I thought I already did that before, but it was other website. I have done all troubleshooting already before making this ticket. I did run again troubleshooting and it did not help. I turned off all the plugins, but it had no effect on the display of the images. I updated and changed the image to one category with plugins turned off.
Just tested other website hidden link and it seems to have same problem.
I have searched the forum for all related discussions and tried to run all troubleshooting and find possible settings that could affect the display of the image.

February 26, 2025 at 2:13 am #16748686

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. Could you tell me which plugin you used to display the Category Header Image? I'm trying to replicate the issue here hidden link but I don't see an option to include the Category Header Image hidden link . Could you check and try to replicate the issue on our sandbox site so that I could investigate this further for you?

February 26, 2025 at 7:58 am #16749420

anttiH-4

Hi,

Category header image is included to Salient theme. Category header image upload button will only appear on the category editing page after the category has been created. I installed Salient theme to sandbox. the image does not appear on the translated page in the test environment after uploading it to default language.

Default language
hidden link

Translated language
hidden link

February 26, 2025 at 3:58 pm #16752047

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for replicating the issue on our sandbox site. I will escalate this to our 2nd Tier Support for further investigation and I will come back to you once I've feedback.

February 28, 2025 at 9:39 am #16759840

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

We have a workaround for this. Kindly open .../\wp-content/themes/salient/nectar/helpers/page-header.php

Look for line 151

Replace:

// Woocommerce archives.
			if( is_product_category() || is_product_tag() || is_product_taxonomy() ) {

				$subtitle 			= '';
				$title 					= woocommerce_page_title(false);
				$cate 					= get_queried_object();
				$t_id 					= (property_exists($cate, 'term_id')) ? $cate->term_id : '';
				$product_terms 	= get_option( "taxonomy_$t_id" );
				$bg 						= (!empty($product_terms['product_category_image'])) ? $product_terms['product_category_image'] : $bg;

with

// Woocommerce archives.
			if( is_product_category() || is_product_tag() || is_product_taxonomy() ) {

				$subtitle 			= '';
				$title 					= woocommerce_page_title(false);
				$cate 					= get_queried_object();
				$t_id 					= (property_exists($cate, 'term_id')) ? $cate->term_id : '';
				// WPML Workaround for compsupp-7882
				if ( class_exists('Sitepress') ) { 
					$t_id  = apply_filters( 'wpml_original_element_id', NULL, $t_id, 'tax_' . $cate->taxonomy);
				}
				$product_terms 	= get_option( "taxonomy_$t_id" );
				$bg 						= (!empty($product_terms['product_category_image'])) ? $product_terms['product_category_image'] : $bg;

This will display the image from the original taxonomy to the translated taxonomy.

February 28, 2025 at 3:40 pm #16761800

anttiH-4

Hi,

Is this code replaced when salient theme is updated?

February 28, 2025 at 3:42 pm #16761803

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. yes correct. But we will share the fix with the theme author and they will add this to their future updates.

March 1, 2025 at 11:05 am #16763770

anttiH-4

Hi,

Just tested workaround and it does not work. It removes image from default language and does not display image on translated pages. I double checked that code is correct and emptied cache. Also tried to update category image after code was implemented.

March 2, 2025 at 7:20 am #16764980

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

You are right, after implementing the PHP code, the header is missing hidden link .

Can I have your permission to deactivate plugins? Also, I need to configure the language option to "Different languages in directories" in WPML > Languages > Language URL format for a test. Also, please turn off any server cache if you have them "on"

March 2, 2025 at 9:25 am #16765075

anttiH-4

Hi,

You have permission to deactivate plugins and configure language options.

March 3, 2025 at 1:28 am #16766567

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I've checked and it looks like you've installed a very old version of the salient theme on the sandbox site that I prepared. So the workaround might not work on the latest version of the salient theme.

I've downloaded the latest version of the salient theme from your Website and I will share this with our 2nd Tier Support for a second look.

March 3, 2025 at 5:50 pm #16770378

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply. Our 2nd Tier Support shared an updated code and I've applied it to your Website. Now it shows up fine now. Eg.

hidden link
hidden link

// Woocommerce archives.
			if( is_product_category() || is_product_tag() || is_product_taxonomy() ) {

				$subtitle 			= '';
				$title 					= woocommerce_page_title(false);
				$cate 					= get_queried_object();
				$t_id 					= (property_exists($cate, 'term_id')) ? $cate->term_id : '';
				// WPML Workaround for compsupp-7882
				if ( class_exists('Sitepress') ) { 
					$default_lang = apply_filters('wpml_default_language', NULL ); 
					$t_id  = apply_filters( 'wpml_object_id', $t_id, $cate->taxonomy, TRUE, $default_lang );
				}
				$product_terms 	= get_option( "taxonomy_$t_id" );
				$bg 						= (!empty($product_terms['product_category_image'])) ? $product_terms['product_category_image'] : $bg;

Could you check?