Problem:We added a custom Chinese language but hreflang is wrong
Solution:1. Go to WPML->Languages -> Add a new language and add the default Chinese language again
2. Click on "Edit languages"
3. Change the hreflang from the default language to something else and update
4. Now you should be able to assign the correct one to the new custom CN language
Problem:
Half of the products has featured images, the other half has not.
Solution:
1. Make sure you have marked both options for media attachments on your original product: 'Duplicate uploaded media to translations' and 'Duplicate featured images'. Then try saving and updating your original and translated product.
2. You can use Media translation plugin and in WPML>Settings>Media translations and try to sync images.
- You need to make sure you click the 'Start' button
Problem: We are getting this error:
Error log is showing the following:
PHP Fatal error: Uncaught InvalidArgumentException: element_id and type do not match for element_id:7283 the database contains post_page while this function was called with post_attachment in xxxx/content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php:32\nStack trace:\n#0 xxxx/content/plugins/sitepress-multilingual-cms/sitepress.class.php(1497): WPML_Set_Language->set('7283', 'post_attachment', false, 'en', NULL, true)\n#1 xxxx/content/plugins/sitepress-multilingual-cms/classes/media/duplication/class-wpml-media-attachments-duplication.php(1016): SitePress->set_element_language_details('7283', 'post_attachment', false, 'en')\n#2 xxxx/wordpress/wp-includes/class-wp-hook.php(286): WPML_Media_Attachments_Duplication->batch_set_initial_language('')\n#3 xxxx/wordpress/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)\n#4 xxxx/wordpress/ in xxxx/content/plugins/sitepress-multilingual-cms/classes/core-abstract-classes/class-wpml-set-language.php on line 32, referer
Solution: In this case the fastest way to solve the issue is by following this steps:
- Create a full backup of the site.
- Connect to the database -> in the wp_posts table delete the row with element ID = 7283
- Double check if the issue persists.
- Repeat this process if the error message appears again with another ID.
Note: Please don't forget to create a full backup of the site because if something goes wrong you will have to restore it.