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 contains 7 replies, has 2 voices.

Last updated by Bruno 4 years, 6 months ago.

Assigned support staff: Bruno.

Author Posts
March 19, 2015 at 9:22 pm #582532

Dan

What do I need to do to make the language switcher appear on the page of a custom post type?

If you go to this "Page" on our site you will see the language switcher correctly appearing in the upper right corner:

hidden link

However, if you go to a "Resource" on our site, the language switcher does not appear, despite the fact that I have in fact created 5 translated versions of this page:

hidden link

Here, for example, is the French version of that page:

hidden link

This "Resource" is a Custom Post Type we created for our site.

Within WPML, I have set the language switcher to be in the WP Menu called "Utility Menu". This is set to appear in the upper right corner of all pages on our site.

As an experiment, I changed to using a Language Switcher widget in one of my sidebars. On a "Page", the switcher was visible and let me switch languages. On a "Resource" the widget appeared there as a box... but the switcher was not visible.

Is there something I need to do within either WPML or within our theme so that the language switcher can work with a CPT?

FYI, the WP theme we are using is one of our own design. It is _not_ set up for localization and so I realize that could be part of the problem. The theme is visible up on Github:
hidden link

Any assistance you can offer would be greatly appreciated. I've now been uploading translations of our site into WP but it's rather frustrating to not be easily able to find them.

Thanks!

March 19, 2015 at 10:15 pm #582548

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

By default, the WPML only displays the flags of the contents that are translated. If you want the flags appear, even without the content being translated, please click on the WPML > Languages > Language switcher options. Look for 'How to handle languages without translation' and select the 'Link to home of language for missing translations' option. Click on the 'Save' button.

If you need to translate custom post types, please click on the WPML > Translation management > Multilingual Content Setup > Custom posts. Select the 'Translate' option next to the custom post type you want and click on the 'Save' button.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Thank you.

March 19, 2015 at 10:45 pm #582554

Dan

Bruno,

Thanks for the reply, but sadly that did not work. When I change the setting to "Link to home of language for missing translations" then the links DO appear on the "Resource" pages, but they simply go to the home pages for the languages, NOT to the translated versions of the "Resource" pages.

Per your second point, I already am translating custom post types. I have been translating these custom post types and HAVE been able to load them into WPML. However, I can't the language switcher to work.

For example, this Resource page:

hidden link

has these translations:

hidden link
hidden link
hidden link
hidden link

but the language switcher doesn't appear on any of these pages.

This works perfectly fine on a "Page" ... but not on the "Resource" custom post type.

Dan

March 20, 2015 at 7:37 pm #584262

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Please as a test, could you disable all non-WPML plugins and see if the problem persists?

Just to make sure, you translated the posts or you added posts in other languages? To translate the post, you must click on the "+" sign.

Thank you.

March 24, 2015 at 3:37 pm #586883

Dan

Bruno,

> Please as a test, could you disable all non-WPML plugins and see if the problem persists?

Unfortunately, this is all being done on a production server and so I can't easily disable all non-WPML plugins. I do have a staging server where WPML is active and I can potentially make this test there... but it will unfortunately be a few days before I can do that given my current work schedule.

> Just to make sure, you translated the posts or you added posts in other languages? To translate the post, you must click on the "+" sign.

Correct. My general process has been:

1. Edit the English language "Resource" (the custom post-type).
2. Control-click the "+" symbol next to each language to open up a new browser tab for each of the translations in the five languages.
3. Go to each tab in sequence, copy in the translated text from a file, publish the Resource, view it to confirm that it works in the language.
4. Close all translation tabs.
5. Close the English language page.
6. Repeat from step #1 for the next Resource.

This process has worked great for translating all the "Pages" (and in my step #5 for a *Page* I can view the page and confirm all the translations work) and seems to work for all my "Resources"... except that I don't get the menu on the top of the Resource pages.

March 24, 2015 at 9:38 pm #587148

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

I need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Please let me know exactly what steps should I follow to see the problem.

Note: Please make a full backup of your site.

Thank you.

March 26, 2015 at 9:53 pm #588912

Dan

Bruno,

Thanks for the reply. Unfortunately I'm not going to be able to do that until next week. I will be back in touch when I am able to provide that access.

Thanks,
Dan

March 27, 2015 at 8:47 pm #589691

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Ok. Please let me know when you're ready.

Thank you.

The topic ‘[Closed] How do I make language switching menu visible for custom post types?’ is closed to new replies.