This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing an issue where the Custom 404 Pro plugin, even though translated following the rules, links to the Italian error page instead of the English one when switching languages. This causes the settings for the Italian page to be deleted.
Solution:
Since the Custom 404 Pro plugin is not officially compatible with WPML, we recommend adding the following custom code to the
functions.php
file in your theme folder:
add_action('template_redirect', function() { global $wpdb; // Define the custom table name $table_options = $wpdb->prefix . 'custom_404_pro_options'; // Get the stored 404 page ID from the custom table $page_id = $wpdb->get_var("SELECT value FROM $table_options WHERE name = 'mode_page'"); if (is_404() && $page_id && function_exists('icl_object_id')) { $translated_page_id = icl_object_id($page_id, 'page', true); if ($translated_page_id && $translated_page_id != $page_id) { $translated_page_url = get_permalink($translated_page_id); if ($translated_page_url) { wp_redirect($translated_page_url, 302); exit; } } } });
Please test this code in a staging environment before applying it to your live site. Additionally, consider contacting the plugin authors to encourage them to join our Go Global Program.
If this solution does not resolve your issue or seems outdated, please check our related known issues, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If necessary, do not hesitate to open a new support ticket.
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 topic is split from https://wpml.org/forums/topic/how-to-translate-givewp-donation-forms-into-english-my-default-language-is-italian/
This topic contains 2 replies, has 0 voices.
Last updated by 1 day, 6 hours ago.
Assisted by: Osama Mersal.