Skip to content Skip to sidebar

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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Carlos Rojas 1 year, 11 months ago.

Assisted by: Carlos Rojas.

Author Posts
August 17, 2023 at 10:11 am #14244833

helena-gwynN

I have a multilingual website with WPML using Pods with Custom Types and its templates. I was able to get my templates translated and used on the different languages by unchecking “Adjust IDs for multilingual functionality”. But I’ve searched around a bit but can’t seem to find an solution for my issues.

I want to print a list of pages which I extended with a checkbox to have it show up in the specific list. I use the ‘Pods Item List’-block. For every page it prints all the languages. How can I limit it to only a chosen language or maybe the language of the template?

I want to print a list of custom categories and underneath each category the associated post-types. I use the ‘Pods Item List’-block with the custom categories. I always prints the links to the categories and post-types in the standard language although the categories and post-types are translated. How do I specify to use which language or reference to the translated values of the taxonomies or post-types?

August 18, 2023 at 2:12 pm #14252945

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hello,
Thank you very much for your message.

1.- I'm truly sorry but I'm not familiar with Pods 🙁

Can you please elaborate a little more so I can better understand? It would be very helpful if you could share a video describing the steps to reproduce the issue.

Also, the first issue might be related to the query used by Pods to display the pages, however, I'm not entirely sure until I get more information and fully understand the problem.

2.- Please increase the WP memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:`

/* Memory Limit */
define('WP_MEMORY_LIMIT', '128M');

- Add it above the line /* That's all, stop editing! Happy blogging. */

You can double-check the WordPress memory limit in WPML -> Support

Regards,
Carlos

August 25, 2023 at 11:20 am #14291475

helena-gwynN

Hi

Thank you for the info about the increase of the memory limit. I assumed changing it for PHP was enough. But that appears to change only the maximum limit.

And I think you're right about how Pods queries everything, at least when using their templating from within WordPress. It shows all the languages for pages, posts, taxonomies ... core or custom. I assume they will address this in future releases. And maybe when using Pods from within PHP, there's more flexibility, but not that wellversed in Pods yet.

I worked around it by adding a custom field 'language' to every object I want to display somewhere using their template system. And then translate each template to the specific language. Within the template I query the specific translation using a few custom functions that uses WPML-hooks. This works, but maybe there are better or more elegant solutions.

[php]
function pods_wpml_permalink($p) {
return apply_filters( 'wpml_permalink', $p, apply_filters( 'wpml_current_language', null ), true );
}

function pods_wpml_post_title($id) {
return apply_filters( 'wpml_get_element_translations', array(), apply_filters( 'wpml_element_trid', false, $id, 'post_post' ), 'post_post' )[apply_filters( 'wpml_current_language', null )]->post_title;
}

function pods_wpml_taxonomy_name($id) {
return apply_filters( 'wpml_get_element_translations', array(), apply_filters( 'wpml_element_trid', false, $id, 'tax_aanbod-categorie' ), 'tax_aanbod-categorie' )[apply_filters( 'wpml_current_language', null )]->name;
}
[/php]

August 25, 2023 at 12:32 pm #14291789

Carlos Rojas
WPML Supporter since 03/2017

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

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

Hi there,
Thank you very much for your message

I'm happy that you found a workaround. Although I don't have a final solution I would recommend you check the query that loads the pages and search for the 'suppress_filters' attribute. This attribute is needed by WPML to display the content by language.

In this ticket, you will find an example: https://wpml.org/forums/topic/wp_query/#post-10163421