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.

This topic contains 12 replies, has 2 voices.

Last updated by Bobby 1 month ago.

Assisted by: Bobby.

Author Posts
April 11, 2024 at 6:14 pm #15510756

nicoleM-23

When on the Spanish version of the site, the Previous and Next links on the Events page go to the English version of the site.

LINK to Example: hidden link

April 12, 2024 at 12:50 am #15511135

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Is this page created using the events calendar plugin?

Try the following steps and let me know your results, please.

1. Go to WPML > String Translation
2. Search for shows-and-events (from "the-events-calendar" textdomain). Translate it
3- Re-save permalinks

April 12, 2024 at 3:39 pm #15513474

nicoleM-23

Hey Bobby,

We are using The Events Calendar, but that string did not appear in the search under any text domain.

Screenshot 2024-04-12 at 11.39.31 AM.png
April 15, 2024 at 9:15 pm #15521970

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby

April 16, 2024 at 9:53 pm #15528335

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for the access details!

How are the events displayed on the page, I can see you are using a template called events, is this a custom template?

April 17, 2024 at 7:16 pm #15534642

nicoleM-23

Yes, the template file is events.php

April 17, 2024 at 7:59 pm #15534760

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you, for confirming.

Are you the developer of this template file or somebody else in your team.

Please note that support for custom work is outside our scope.

I'll guide you as best I can, but if you need further assistance, consider reaching out to one of our trusted third-party contractors who specialize in custom WPML work.

You can find them here: https://wpml.org/contractors/

when reviewing your template I can see that the pagination is created using next_posts_link() and previous_posts_link()

these do not account for the language parameters.

You might want to review our Hooks documentation, especially wpml_permalink.

https://wpml.org/wpml-hook/wpml_permalink/

April 18, 2024 at 3:19 pm #15539981

nicoleM-23

Our developer is assisting with this issue. She has reviewed the documentation, but it is not very clear.

From her:
The documentation provides one-line examples devoid of context and assumes we know the language code that needs to be output. Given that we're on a template using standard WordPress core functions, we need a solution that accounts for that.

Do I need additional work to establish the language code/directory that is currently active?

April 18, 2024 at 9:32 pm #15541136

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Thank you for updating us, yes you would need to create additional work and some sort of logic in order to filter for the language code.

At the moment the function that is being used for pagination does not take in account language directories thus this happens, if you do a quick search on that function you will find some other issues with it and directories being ignored.

The standard for linking between posts would be something like:
<!-- Start the pagination functions after the loop. -->
<div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div>
<div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div>
<!-- End the pagination functions after the loop. -->

Source -> https://developer.wordpress.org/themes/functionality/pagination/

This would be numeric pagination for an archive:
echo the_posts_pagination();

Possibly this helps your developer, however, i suggest using a different function for the pagination than next_posts_link()

April 23, 2024 at 7:18 pm #15557874

nicoleM-23

Hey Bobby,

Thanks for clarifying! We'll pass this along to our developer and get back to you if she has any questions.

April 23, 2024 at 11:38 pm #15558467

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

No problem, glad I was able to provide some assistance.

April 25, 2024 at 1:17 pm #15565850

nicoleM-23

Hey Bobby,

Alexis, Nicole's dev, here 🙂

It turns out the issue wasn't in the pagination functions, but the query. There was an additional plugin causing a conflict and altering the URLs.

We've got that resolved now, but wanted to let you know 🙂

April 25, 2024 at 7:40 pm #15567216

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi Alexis,

Thank you for updating us! I am sure this will help others who might face a similar issue in the future.

Glad to hear it is working OK now.

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