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

Last updated by Bruno Kos 3 weeks, 6 days ago.

Assigned support staff: Bruno Kos.

Author Posts
September 13, 2019 at 8:48 am

jeroenV-36

I am trying to:
get pagination working on a custom post type, it works on the main language of the site, but when using another language, it keeps redirecting the next_posts_link to the main language page...
Link to a page where the issue can be seen:
hidden link
I expected to see:
That it would go to the next page on the current language
Instead, I got:
it keeps redirecting to the main language

September 13, 2019 at 9:41 am
September 13, 2019 at 12:21 pm #4568533

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

This has been escalated to our 2nd Tier team and may take some debugging time, I'll get back to you as soon as I have any news or questions for you.

Regards,
Bruno Kos

September 16, 2019 at 6:58 am #4576659

Bruno Kos
Supporter

Languages: English (English )

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

Hi,

According to our further debugging, you cannot mix with get_posts with WP query. You should be using something like the following - store the custom query to global variable and then use pagination functions:

https://wordpress.stackexchange.com/questions/216821/pagination-in-plugin-with-custom-post-type/216830#216830

Otherwise this falls outside of the scope of support work, so we suggest you reach our contractors:
https://wpml.org/contractors/

Because this may require custom code or rewriting at least part of it, along with proper testing.

Regards,
Bruno Kos