Skip Navigation

This topic contains 0 replies, has 1 voice.

Last updated by nathanY 2 weeks, 1 day ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
October 23, 2024 at 1:03 pm #16321930

nathanY

Background of the issue:
I am currently using WPML on my WordPress site, which includes a custom post type called products. My goal is to prevent specific product titles from being translated across the entire site. I have added the following code to my theme's functions.php file: get_var($wpdb->prepare("SELECT `field_data` FROM `wp_icl_translate` WHERE `field_type` = 'original_id' AND `job_id` = %d", $job_translate["job_id"])); // Check the post type $posttype = get_post_type($postid); // If the post type is 'products', exclude the title from translation if ($job_translate["field_type"] == "title" && $posttype == "products") { return false; // do not translate the title } // Default behavior return $is_translatable; } ?>

Symptoms:
Despite the above implementation, the product titles are still being translated by WPML, which is contrary to my requirements.

Questions:
Could you please assist me in troubleshooting this issue?
Are there alternative methods or settings that need to be configured to exclude product titles from being translated?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.