Hello,
I am writing to inform you about an issue I am facing with translating page titles in WooCommerce. I used the following code to translate the “Shop” page title to “Tienda”:
add_filter(‘the_title’, ‘custom_woocommerce_page_title’, 9999);
function custom_woocommerce_page_title($title) {
global $post;
// Check if we are on a WooCommerce page.
if (is_woocommerce()) {
// Change the title if it’s “Shop” or “Compare”.
if ($title === ‘Shop’) {
return ‘Tienda’;
}
if ($title === ‘Compare’) {
return ‘Comparar’;
}
}
// If none of the above conditions are met, return the original title.
return $title;
}
However, this code does not work for “Wishlist” and “Compare” page titles. Additionally, I tried using Loco Translate, but it did not help in translating these titles as well. Could you please help me resolve this issue? In addition, I would also like to translate other marked texts on my website.
I look forward to your assistance and thank you in advance for your help.
Attachments:
You must be
logged in to view attached files.