Skip Navigation

[Résolu] Custom Post type is translated but doesn't get filtered by page language

This support ticket is created Il y a 2 années et 9 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9: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: Africa/Casablanca (GMT+01:00)

This topic contains 4 réponses, has 2 voix.

Last updated by Jamal Il y a 2 années et 9 mois.

Assisted by: Jamal.

Auteur
Publications
#2110169

I am trying to:
my "comunicati stampa price sensitive" are a CPT with a non-translated taxonomy. They are translated (mostly) but on the Italian Page even the english translations show up

Link to a page where the issue can be seen:
hidden link

I expected to see:
only the italian ones on this page and only the english ones on this
hidden link
page
Instead, I got:
both IT and EN posts on the Italian page.

WPML support told me to get your support cause they can't find the problem in your filters.

#2110349

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting Toolset support.

I don't think that WPML allows to translate posts and keep categories non translated. Can you share with me the WPML support ticket so, I can check what the support team has tried with you.

AFAIK, if you are translating posts, the taxonomies need to be translated too.

#2110383

It was a chat with them

https://wpml.org/forums/topic/wpml-chat-support-ticket-by-robertom-8-1625832948/
So there is no ticket

Point is, i also translated the custom taxonomies, but nothing changed.
I believe that, because i'm using a WP-view (view-tabella-comunicati-stampa-price-sensitive) inside a page.
This view has a repeater fields view inside (view-repeatable-fields).

I guess I need to force the loop to be in the language of the page

<!-- wpv-loop-start -->
		<wpv-loop>
          <tr>
          <td class="custom-table-border-title">[types field="titolo-file"][/types]<p>
            [wpv-conditional if="(empty($(wpcf-data-documento)) )"][ain_file_last_modified_date parent_id='[wpv-attribute name="custom-post-id"]'][/wpv-conditional]
            [wpv-conditional if="NOT(empty($(wpcf-data-documento)) )"][types field='data-documento' format='d/m/Y G:i'][/types][/wpv-conditional]
            <small></small></p></td>
          <td class="custom-table-border-texticon"><a href='<em><u>hidden link</u></em> field="file-documento" output="raw"][/types]&titolo=[types field="titolo-file"][/types]'>[mk_font_icons icon="mk-moon-eye-4"] <span class="ain-hidden-mobile">[wpml-string context="ain-framework"]Anteprima[/wpml-string]</span></a></td>
          <td class="custom-table-border-texticon"><a href="[types field='file-documento' output='raw'][/types]">[mk_font_icons icon="mk-moon-download"]<span class="ain-hidden-mobile">[wpml-string context="ain-framework"]Scarica[/wpml-string]</span></a></td>
      	</tr>
		</wpv-loop>
	<!-- wpv-loop-end -->
#2110769

Sorry I can't edit my answer.
The previous code is the Repeater Field View. I think I need to force this to check if the language of the CPT matches the one from the page.

Because at the moment it doesn't

#2110973

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+01:00)

As I explained in my previous reply, if you are translating posts, you must translate the taxonomies too.

Currently, the taxonomy is not translatable. Check this screenshot hidden link
Even though, the terms are duplicated, probably because of a previous translation. The slugs let me think so.

So, I changed the configuration for the taxonomy, and yes, it was translated before, and the terms are linked across languages.

The view on the other hand does return the correct posts. As you can see in this screenshot, the Italian page returns the Italian posts, and the English page returns the English posts. Check the IDs from the screenshot hidden link

The issue is that the repeatable fields are duplicated in both languages. Check this screenshot hidden link

So, I'll suggest that you remove the repeatable field group item that does not patch its language. Or retranslate the posts.

I'll remain at your disposal.

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