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

Last updated by Bruno Kos 5 months, 3 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
March 21, 2019 at 4:20 am

johnC-48

I am working on a dual-language site - English and Malay.

The requirement is to make all of the pages dual-lingual except for the programme archives. These archives make up the bulk of the site, with around 500 pages.

The archives consist of 4 different types - Theatre, Dance, Events and Festivals, tho only the first two are used at the moment. These are Custom Post Types that were created with a plugin called Custom Post Type UI.

How a site visitor gets to the archive is that she will be led through a series of (standard) pages that filter the journey based on her intended requirement. Let's say if someone wanted to look at theatre programmes in the 1990s, she would go through the following pages (example): Programmes > Theatre > Theatre in the 1990s.

In every Decades Page, say "Theatre in the 1990s", there is a WP-Bakery Page Builder grid of feature images from the custom post type pages of all the theatre performances in the 1990s. This grid is filtered by taxonomy. These Decade Pages should also be the last translatable page as we do not want the custom post type pages to be translated.

I've completed all of the pages and updated all the content. However on the decades pages in Malay, the grid points to a Malay version of the archive that was automatically created by WPML, instead of the English version as intended. This might be ok (but not ideal) if the Malay version of the archive showed all of the content that the English page has, but the images are missing.

Ideally, we'd like to forgo the Malay archive pages altogether, so that a decades page in any language still points to an "English*" archive.

*Note: I say English but in reality there are two languages on every custom post type page.

I am trying to:
Ensure that all Decades pages point to English only custom post type pages.

Link to a page where the issue can be seen:
How can I hide links, instead of sharing them in public?

I expected to see:
Links in the grid on the pages of both URLS above (as well as those for the other decades in all four categories) should point to their English custom post type pages only.

Instead, I got:
Links on the Malay language pages pointed to automatically translated Malay pages that did not have any images in their galleries

March 21, 2019 at 9:57 am #3397661

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

All the links posted here will not be visible to public. Only you (and other WPML supporters) will see them, for others these will be hidden. I do think that it will help me understand this much better if I see all the URLs with issues/concerns in question.

Regards,
Bruno Kos

March 21, 2019 at 10:24 am #3398033

johnC-48

Hi Bruno,

Thanks for helping with this.

An example of the issue can be found at the following decade page and its corresponding translated page:

(Original/English)
hidden link

(Malay)
hidden link

Both pages should point to an Original Language/English custom post type page. The English version works fine, but the Malay version points to an automatically generated Malay page without images.

March 21, 2019 at 2:50 pm #3408361

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Did you consider making a redirect of the Malay archive pages or removing language switcher using CSS perhaps from those templates?

But as for this:

but the Malay version points to an automatically generated Malay page without images.

But isn't this simply a translation of that template, or?

Let me know if I am not seeing this clearly and somehow I think that I am not in fact.

Regards,
Bruno Kos

March 21, 2019 at 3:42 pm #3410527

johnC-48

Hi Bruno,

Thanks again for getting back to me. Perhaps the way I explained it caused some confusion. I'm glad that you share that specific screenshot tho, as it will help in clarifying things, I think.

That specific screenshot page is a translation of an English page, with the English page being the original language.

The post grid that you see in the screenshot uses custom taxonomies categories to build the query - these consist of categories for each year from the 1990 to 1999. So any particular archive that is assigned to a specific year in the 1990s will display in the grid.

These above custom post type categories are meant to be English only.

Essentially, once you click on any one of the images on the translated page above, it should take you to an archive entry in the original language. Right now, for some reason, the images are linked to an automatically generated translated page instead.

So, if I clicked on the top right hand image on the grid in the Malay screenshot - Black Comedy | The Lesson (1990), it should take me to:

hidden link

instead, it goes to:

hidden link

It's just these translated decade pages that are the problem. Everything else on the site (with regards to language) seems to work well.

March 22, 2019 at 9:53 am #3438953

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

So in short, it should be:
hidden link

and not:
hidden link

When you open any link from:
hidden link

I think I am getting it more clearly now :). Such behavior might mean at least these two things:
- all these have Duplicates (Based on the post ID from within the code, both of these seem to be the same posts in fact, so not duplicates.)
- try setting WPML -> Setttings -> Post Types Translation (for that post type) to Not translatable - what does this change do (it might not allow us to see hidden link however)

However, since you are allowing:
hidden link

I am still wondering what kind of solution would allow us to and whether this is a possible scenario:
- allow CPT archive to be translated
- show English custom posts when on Malay archive page

Regards,
Bruno Kos

March 22, 2019 at 11:21 am #3439755

johnC-48

Hi Bruno,

The thing is, the CPTs have always been set to 'Not Translatable' (see attached), which is why we're finding it weird that there were auto translated version of each CPT post.

hidden link and other pages like them are not CPT posts tho. They're standard WP pages using the default template. We refer to these pages as Decades Pages, but only to circumvent any confusion with the archive pages made up of CPT posts, of which there are over 500.

It would be perfect if we could just show English custom posts (in the grid) when on a Malay archive page.

I feel that we're funnelling down to a solution tho. Thanks for your patience with this.

March 22, 2019 at 2:14 pm #3441105

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

It would be perfect if we could just show English custom posts (in the grid) when on a Malay archive page.

That's the thing - since WPML uses language parameters for archives etc, not sure how can we mix those unless we are on default language.

which is why we're finding it weird that there were auto translated version of each CPT post.

This isn't the case, however. I've checked the code and this is what I found:

theatre-template theatre-template-mamp-single-post theatre-template-mamp-single-post-php single single-theatre postid-12215 header_10 nicescroll wpb-js-composer js-comp-ver-5.5.5 vc_responsive

That is for:
hidden link

And this is for:
hidden link

theatre-template theatre-template-mamp-single-post theatre-template-mamp-single-post-php single single-theatre postid-12215 header_10 nicescroll wpb-js-composer js-comp-ver-5.5.5 vc_responsive

So that is the same post - if it wasn't, postid-12215 value would be different. So perhaps a better idea would be to find out why images are not loading on those "duplicates" - perhaps some JavaScript has not loaded or something in those lines. Does it happen if you try another theme perhaps?

Regards,
Bruno Kos

March 23, 2019 at 9:48 am #3445843

johnC-48

Hi Bruno,

You're right. Both these posts have the same postid, just different URLs.

I've tried using a different theme, and the issue is still the same, unfortunately. I deactivated WPML and found that the pages worked as originally planned, so in that sense WPML is working as it should re the language parameters as you mentioned.

I can't work out why the images aren't loading when /?lang=ms point to the postid tho.

March 23, 2019 at 2:12 pm #3446629

johnC-48

Hi Bruno,

In addition to the above, I've discovered that the images load for a second set of CPTs - Dance. Where the 1980s Decade in both languages can be found

Here:
hidden link

and here:
hidden link

Images load on both versions of the archive pages:
hidden link
hidden link

Both CPTs (Theatre and Dance) are identical except for labels and position on the admin menu.

Further, the Dance page template is a clone of the Theatre one.

So it's really odd that the images are appearing for one CPT but not the other.

March 25, 2019 at 11:19 am #3452469

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Indeed it shows up and if they are both clones, we will have to debug what's behind the scenes here. Would you allow me to create Duplicator package of your site for further debugging (I would most likely send this to our 2nd tier)?

Regards,
Bruno Kos

March 25, 2019 at 11:41 am #3452931

johnC-48

Hi Bruno,

You can. So long as it doesn't change or break anything on the site right now. Or would you prefer to create a Duplicator package of the staging site?

March 25, 2019 at 2:59 pm #3455143

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Creating Duplicator package would not break anything. I can create a package on any site, as long as both are the same with the issue being present.

I've marked your next reply as private if you want me to do this on staging site.

Regards,
Bruno Kos

March 25, 2019 at 3:39 pm
March 25, 2019 at 3:50 pm #3455677

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I get "ERROR: Incorrect username or password." for those credentials, does it work for you?

Regards,
Bruno Kos