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 thread is resolved. Here is a description of the problem and solution.

Problem: Go to single event page, through "NEXT GAME" countdown + "UPCOMING FIXTURES" event list widgets. It doesn't work and i'm getting redirect error

Solution: Add this code to functions.php:

add_action( 'pre_get_posts', function ($query){
    if ( is_user_logged_in() || defined('DOING_AJAX') ) {
        return;
    }
     
    if ( $query->is_main_query() && $query->query_vars['post_type'] == 'sp_event' && $query->is_single ) {
        $query->set( 'post_status',  array('future', 'publish') );
    }
});

Relevant Documentation:

100% of people find this useful.

This topic contains 25 replies, has 4 voices.

Last updated by softcodexs 1 year, 7 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
February 15, 2018 at 10:45 am

johnM-50

I am trying to:
Go to single event page, through "NEXT GAME" countdown + "UPCOMING FIXTURES" event list widgets. It doesn't work and i'm getting redirect error.

I've deactivated all 3rd party plugins and it worked perfectly. When i activated WPML it doesn't work. And it's funny that it works when i'm logged into as admin. But when i'm not logged into the admin area it doesnt work.

Link to a page where the issue can be seen:
I don't want to give the address to the site since it's not official yet.
Please see the information i sent to you privately there you can see the address to website.

I expected to see:
Single event page to every game.

Instead, I got: ERR_TOO_MANY_REDIRECTS

February 16, 2018 at 8:14 pm #1520707

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

I am unable to view your site at the link provided, and although I am able to login, I don't have administrative access so I can't see anything other than my profile on the dashboard. Can you please adjust the user role so that I have access?

In the meantime, please go to WPML -> Languages and scroll down to the Language Filtering for Ajax section. Check the box to enable "Store a language cookie to support language filtering for AJAX".

Lastly, please make sure your events have been translated to both languages. Also try changing the URL format in WPML -> Languages, and let me know if that changes the results.

If you can share a URL where I can see this issue and reproduce it, that would be helpful. You can edit your previous reply and add a link if you would like. When I try to access the link now, I see a message that the site is in maintenance mode.

February 16, 2018 at 9:05 pm #1520737

johnM-50

I'm very sorry, i've now changed from subscriber to admin.

I've ticked in Language Filtering for Ajax Section.
It still doesn't work

I've changed url format too and resaved permalinks
and it still doesn't work

I don't want to share the URL here. Only as PM.

But if you go to main page and try to click on any of games. For example Grecce vs Sweden or Belgium vs Sweden at top. It works for you when you're in admin area. But if you arent logged into admin area. It doesn't work.

It's okay to set under construction mode to off if you want to test.

February 19, 2018 at 6:00 pm #1522703

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi John,
My name is Carlos and I will be taking this ticket because our colleague Lauren is off today.

1.- I logged into the site and I noticed that none of the Matches posts are translated. I then went to WPML -> Translation Management -> Multilingual Content Setup -> Post Types Translation section -> And set 'Matches (sp_event)' to 'Translatable - use translation if available or fallback to default language' for a moment -> Saved the changes -> Visited the front page and everything seems to be working fine. -> Then I rolled back the change.

I suspect the issue will be solved by translating the Matches to from English to Swedish. Please translate one of the matches and let me know if the issue continues.

2.- Please increase the PHP 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');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

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

Looking forward to your answer.
Kind regards,
Carlos

February 20, 2018 at 9:28 am #1523244

johnM-50

Hi Carlos,

But if you compare the game between Greece - Sweden with the game with Belgium Sweden
No one of them are translated? And Greece vs Sweden works fine. Belgium vs Sweden didn't work.

In admin area both of them works. What's the difference then?

For your information, i don't need to translate the whole page. Only string translations. How should I do it in a properly way?

I've increased the memory limit to 128 mb.

February 20, 2018 at 2:53 pm #1523766

johnM-50

Found out a new issue connected to sp_matches. If i'm choosing it to translatable then Scoreboard from Sportspress Pro disappears.

February 20, 2018 at 3:08 pm #1523793

johnM-50

I have found the issue here. I don't know why though.

if the match has been played the link works perfectly.
But if it's a scheduled match the link doesnt work.

Please take a look asap.

February 20, 2018 at 5:14 pm #1523977

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi,

I kindly ask you to create a new ticket regarding this new issue, this way we will be following the forum's rule of one ticket per issue. It will also help future clients to fins answers to similar issues.

While you create the new ticket you can add me directly as the supporter an I will be more than happy to help you with this.

Thank you very much for your understanding.
Kind regards,
Carlos

February 20, 2018 at 9:54 pm #1524246

johnM-50

Thats okay no problem but the main issue above persists. Have you looked into it?

Best regards

February 21, 2018 at 2:13 pm #1524976

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi,

I'm not sure to understand what do you mean with "Belgium vs Sweden didn't work". I have double checked the site and both match pages are shown for both languages correctly. The only difference I see is belgium-vs-sweden missed some information. Is this the remaining issue?

If this is the case you need to go to WPML -> Translation Management -> Multilingual Content Setup -> Taxonomies Translation -> And set the options according to your goal.

For instance if you desire to show the arena (ground) with the same content for both languages then you need to set this taxonomy to 'Translatable - use translation if available or fallback to default language' or 'Not Translatable', depending if you are going to translate the values for this taxonomy or not. You can read more about it in the following links:
- https://wpml.org/documentation/getting-started-guide/translating-post-categories-and-custom-taxonomies/
- https://wpml.org/documentation/beginners-guide-to-site-translation/translating-taxonomy/

Regarding the question on how to translate the strings. The properly way to translate the strings that are not content is through WPML -> String Translation. Please visit this link for more information: https://wpml.org/documentation/getting-started-guide/string-translation/

Regards,
Carlos

February 22, 2018 at 3:19 pm #1526364

johnM-50

Please do this ticket private. I don't want to send links which is visible for public.

February 22, 2018 at 4:19 pm #1526469

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi,

I have set your next answer private. Only you and me will have access to the information provided.

Note: Fill the credential fields with dummy content.

Regards,
Carlos

February 22, 2018 at 4:51 pm
February 22, 2018 at 7:07 pm #1526677

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi,

I was able to see the issue when logged out.

This new site seems to be a copy of the previous site, can I make further tests withouth affecting the development of the final site?

Looking forward to your answer.
Kind regards,
Carlos

February 22, 2018 at 7:16 pm #1526682

johnM-50

Yes. It’s a clone of main site. Feel free to make changes.

Best regards