Hi,
found solution. The needed change needed is in the plugin Polylang.
in polylang/frontend/frontend-links.php change
add_action('wp', array(&$this, 'check_canonical_url'), 10, 0); // before WordPress redirect_canonical, avoid passing the WP object
to
add_action('wp', array(&$this, 'template_redirect'), 10, 0); // before WordPress redirect_canonical, avoid passing the WP object
This works on PolyLang 1.7.6 and NextGEN 2.1.0.
Thread Starter
Chouby
(@chouby)
@mjakop
What you do is wrong and will break something.
As far as I have tested on my website everything still works after this change.
@mjakop, this is what those changes do for me: http://img.ctrlv.in/img/15/07/06/559a833bd0e98.png
Don’t know where you took that from but template_redirect is not in PLL_Frontend_Links model.
P.S. If you follow the link to gallery in albums, result is: “no images found”. What I do is set: $redirect_url = $requested_url;
To skip this check:
if ($do_redirect && $redirect_url && $requested_url != $redirect_url) {
wp_redirect($redirect_url, 301);
exit;
}
its not global so no harm done, unless the $requested_url doesnt exist anymore for real.
P.S. In my optinion 404 would be better instead of 301, or at least 303. If language doesn’t exist then redirect to something that exists (Something with no language or default one, should surely exist, it 100% more valid to look at some information, than to and information that makes you stressed). If wordpress data wasn’t serialised I would suggest looking up slug with LIKE %first_4_letter_of_slug%, but now, I know not how to do it with serialised data. 🙂 Thanks for attention 🙂
@mjakop – Thanks for sharing.
– Cais.
Sorry, is there a fix for this issue?
@informatique – Please start your own topic so we can try to help you with your specific issue on your specific site.
See http://codex.wordpress.org/Forum_Welcome#Where_To_Post
Thanks!
– Cais.
Hi,
found solution. The needed change needed is in the plugin Polylang.
in polylang/frontend/frontend-links.php change
This solution don’t work for me.
But in this file i found function called check_canonical_url and add:
if ( is_page_template('page-gallery.php')) {
return;
}
for page where I’m using NextGen Gallery.
Thread Starter
Chouby
(@chouby)
Yes there are ways to hack Polylang to work around the NextGen Gallery bug putting two slashes in urls (these 2 slashes cause the redirection by Polylang as it is detected as a wrong url).
Another user of both plugins digged into NextGen Gallery code (I didn’t) and it seems that he found the source of the second slash. See:
https://wordpress.org/support/topic/clicking-slideshow-opens-homepage?replies=23#post-7555706
@chouby – If you are still having these issues please contact us directly so we can help you work through the issues you continue to see.
Try either of these pages:
– http://nextgen-gallery.com/contact/
– http://nextgen-gallery.com/report-bug/
Thanks!
– Cais.