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 – 13:00 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 5:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Tagged: 

This topic contains 9 replies, has 0 voices.

Last updated by Otto 1 week, 2 days ago.

Assisted by: Otto.

Author Posts
May 6, 2025 at 3:15 pm #17002498

Chad Warner

Background of the issue:
I am trying to ensure that the 'Office' CPT on hidden link remains in English even when a user switches to French. I changed the CPT to 'Not translatable,' but this caused issues. I can replicate the problem on the dev site and provide credentials for viewing.

Symptoms:
The language switcher breaks on the office archive page, and I still see French content within the office CPTs, regardless of the selected language.

Questions:
Why does setting the 'Office' CPT to 'Not translatable' break the language switcher?
How can I ensure that the 'Office' CPT displays only in English, regardless of the selected language?

May 7, 2025 at 1:03 pm #17006731

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

I visited:
hidden link

switched to French:
hidden link

and it looked right to me.

The office's text is in English, but the rest of the page is in French. This is expected.

Did you manage to fix it? If not, can you please elaborate?

In any case, I enabled a private reply so you can share credentials if needed.

Maybe I'll need to replicate your site locally. For this, I'll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site.
This will allow me to create a copy of your site and your content.
Once the problem is resolved, I will delete the local site.

**IMPORTANT**
- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields.

Best Regards,
Otto

May 7, 2025 at 4:49 pm #17008010

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks, but the Server Protection details are not working for me. Can you please check them?

Best Regards,
Otto

May 7, 2025 at 8:58 pm #17008883

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks. I managed to log in now.

It looks like you are using a custom theme. Please note that we are currently not able to provide support for custom work within this forum.
I will, however, try to point you in the correct direction.

The file:
wp-content/themes/salas/header.php

includes a switcher in the tertiary menu. If the office CPT is not translatable, the switcher breaks. I can't dig deeper into why that happens.

I suggest skipping the switcher in that case, like this:
replace line 70

        <?php wp_nav_menu( array( 'menu' => 'Languages Navigation','container' => 'nav','container_class' => 'site-header__languages-navigation','menu_class' => 'menu-languages js-dropdown' ) ); 

with

        <?php if ($_SERVER['REQUEST_URI'] == '/offices/'): ?>
          <?php wp_nav_menu( array( 'menu' => 'Tertiary Navigation','container' => 'nav','container_class' => 'site-header__tertiary-navigation','menu_class' => 'menu-tertiary' ) ); ?>
        <?php endif; ?>

I hope these will point you in the right direction.

Best Regards,
Otto

May 8, 2025 at 2:25 pm #17012532

Chad Warner

Thanks. Unfortunately, that code did remove the broken menu from the Offices page, it also removed the language switcher from all pages (example: hidden link). Maybe that's because the language switcher isn't in the Tertiary Navigation menu; it's in the Languages Navigation menu.

I tried to adapt your code to include the Languages Navigation rather than the Tertiary Navigation, but that removed the language switcher from all pages, and didn't fix the broken nav menu on the Offices page.

Also, some offices are still showing French content on the US page: hidden link (note "ÉTATS-UNIS" rather than "UNITED STATES"). So that's still a problem unrelated to the language switcher.

May 8, 2025 at 2:36 pm #17012618

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks.

About

Some offices are still showing French content on the US page: hidden link (note "ÉTATS-UNIS" rather than "UNITED STATES"). So that's still a problem unrelated to the language switcher.

This expected.

Probably those offices appear twice, once in French and once in English. Your site already has offices in both languages, there are office posts that have already been translated. When you make the CPT untranslatable, all the content remains.

What you can do is the following:
❌ Please make a full website backup before proceeding ❌
- Make the CPT translatable
- In the WP dashboard, go to Offices
- Switch to French using the language switcher in the admin bar
- Trash all the translated office posts
- Empty the Trash
- Set the CPT untranslatable again

Best Regards,
Otto

May 8, 2025 at 5:42 pm #17013239

Chad Warner

Thanks! That fixed the offices showing in French on US pages. Are you able to help any more with the navigation menu problem, or not, because it's a custom theme?

May 8, 2025 at 7:36 pm #17013629

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

I am glad that helped.

If you have any specific questions, I'll be happy to help. But I can't debug the custom theme. I am sorry, it's outside our support scope and probably outside of my knowledge :).

Best Regards,
Otto

May 12, 2025 at 1:42 pm #17023249

Chad Warner

We're still working on this, and may need more help. Please keep the ticket open.

May 12, 2025 at 1:45 pm #17023261

Otto
WPML Supporter since 09/2015

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Thanks for the heads up.

The ticket will remain open for two weeks without activity.

Best Regards,
Otto