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
13:00 – 17:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

This topic contains 8 replies, has 3 voices.

Last updated by Eran Helzer 1 year, 10 months ago.

Assisted by: Eran Helzer.

Author Posts
July 14, 2023 at 9:57 am #14039031

shahbazF

I have added custom WP_Query to show posts in sidebar and in query I have set posts_per_page 3. It is working on english page but not working in vietnamese language.

English Page URL : hidden link

Vietnamese Page URL : hidden link

July 14, 2023 at 2:33 pm #14040451

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+03:00)

Hi there,

Thank you for contacting WPML support. While you are waiting for one of my colleagues to take this ticket and work on it, let me provide you with the first debugging steps or if I can help with the issue quickly.

The link to the Vietnamese page redirects to the English page. When you say it's not working, please let us know what you mean by that. Does it display all posts or nothing?

Also, please share the code you're using for that WP_Query.

Looking forward to hearing back from you.

July 17, 2023 at 5:12 am #14045703

shahbazF

Hi Ahmed Mohammed,

Thanks for your support,

Can you please check the Vietnamese page , the sidebar post per page functionality is not working on all Vietnamese posts

URL : hidden link

Code :

$query_args = array(
'posts_per_page' => $posts_per_page,
'offset' => $offset,
'orderby' => $orderby,
'order' => $order,
'post_type' => 'post',
'post_status' => 'publish',
'suppress_filters' => false,
);
$wp_query = new WP_Query(apply_filters('widget_posts_args',$query_args ));

post per page value is coming dynamic from backend, even i have used static but its not working.

Screenshot_3.jpg
July 17, 2023 at 9:04 am #14047639

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

First I would like to point out two things:
- From the debug information you supplied I can see that the WordPress memory limit is set to 64MB. You should increase this to 128MB, as that is the minimum requirement for using WPML in the best way.
You can see how to do that here:
https://wpml.org/home/minimum-requirements/
https://wpml.org/faq/checklist-before-opening-a-ticket-in-wpml-support/#how-to-increase-your-sites-memory-limit
- Your WPML Multilingual CMS is outdated. Please update it to the latest version:
https://wpml.org/faq/install-wpml/#automated-updates

Regarding your issue, I want to confirm I understood it correctly.
First, you tried to set "posts_per_page" with a static value, and that did not work.
Now this value is defined in the admin backend, but still the Vietnamese page displays more than 3 posts.

I would like to request admin access to your site, in order to take a look for myself.
Please point me to the exact file where the query is.

I have set your next reply to be private so you can share credentials there.
Remember that it is always better to create a new admin user for me, then when we are done you can delete it.

July 19, 2023 at 11:53 am #14065839

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

It is asking me for a backup verification code.

Your next reply is also private.

July 19, 2023 at 12:04 pm #14065895

shahbazF

Hi Eran Helzer,

You can use following backup verification code.

92702085
28770548
37225727
69722646
74396419
46996994
90736353
19975736
53033238

Thanks

July 19, 2023 at 12:39 pm #14066145

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Okay, a few things:
- It seems that the widget has no effect on the page at all, removing it does not change the frontend of the pages your directed me to
hidden link
hidden link
- I don't see from your screenshot where the string is registered for translation
- I couldn't look at the files, but from the screenshot it does not look like you are following our documentation on translating user input texts. There is an example there with translating texts from widgets, please make sure to follow it:
https://wpml.org/documentation/support/translation-for-texts-by-other-plugins-and-themes/
- WPML String Translation is not installed, which is needed in order to translate user input text

If you want me to be able to point out to you where you are not using WPML correctly, I need to be able to see the code.
Please provide a Duplicator package, so I can do that.

July 20, 2023 at 4:27 am #14069087

shahbazF

Hi Eran Helzer,

I had share the preprod link with you, Can you please check the below preprod links ?
you will see the change in

hidden link
hidden link
Site access detail:
username : cognita
password : tgbygv

- WPVIP does not support WPML string translation

I would like to tell for your information with the same code which is working on our staging server but not working in live and preprod.

Can you please check the below staging links :

hidden link
hidden link
Site access detail:
username : cognita
password : tgbygv

July 21, 2023 at 5:14 am #14075611

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Well, after trying to have an English widget and a Vietnamese widget separately, it looks like the value is simply not used by the Vietnamese widget.

I can't explain how this works on one server and not the other, especially since I can't see the code.

If you pass me a Duplicator package of the site, where the issue occurs and with admin credentials on it, I could take a deeper look at the code, but without that there isn't much I can do.

I will say that custom code is outside of our support policy. However, if I may see it, I can suggest what I think will help solve the issue.

Your next reply is private, if you want to pass along the package.

The topic ‘[Closed] posts_per_page not working in Vietnamese language’ is closed to new replies.