The functions.php file inside the English (/en) child theme:
<?php
function language_redirect() {
if ( !is_user_logged_in() && !is_admin() ) {
$user_lang = substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 );
if ( $user_lang == 'fr' ) {
wp_redirect( home_url( '/fr/' ) );
exit();
}
}
}
add_action( 'template_redirect', 'language_redirect' );
functions.php file inside the French (/fr) child theme:
<?php
function language_redirect() {
if ( !is_user_logged_in() && !is_admin() ) {
$user_lang = substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 );
if ( $user_lang == 'en' ) {
wp_redirect( home_url( '/en/' ) );
exit();
}
}
}
add_action( 'template_redirect', 'language_redirect' );
( Thank you to narolainfotech (@narolainfotech) )
I suspect the problem might be that the wp_redirect appends the home_url with either “/en/” or “/fr/”. But as the two home_url’s are already example.com/en and example.com/fr this code results in “example.com/en/fr/“, “example.com/fr/en/“, example.com/en/en/, etc .. which don’t exist.
Is there a way to fix this? Or is this code correct and the problem is elsewhere (like between my keyboard and my chair <g>) ….?
]]>How can I make it happen that images going to sub-folders?
greetings,
Willem
What is the best way for the plugin to recognize the images in the subfolders? The subfolders are auto generated every day so i am not able to know the paths ahead of time and they will keep growing.
]]>The photographs are located in yearly folders. Each yearly folder has upwards of 10 subfolders.
What is the best method for creating all the sub-folders?
Drag-and-drop uploads everything, but without the folder structure
David
]]>The only drawbacks are it’s a bit slow and the interface is a bit clunky. However it does the job and I’ve used it for 5 months with no issues.
]]>From what I have seen in some online documentations , If I can get the certificate to work on the main site such as www.example.come then it should work for all the sub-folders such as www.example.come/site01 .
Is anyone out there have any advice or have installed WordPress multi-site sub-folders running WAMP ? Thanks.
I have implemented the Photo Gallery plug-in onto my website and although I’ve had a few problems my major problem is that I would like to organize pictures uploaded into the photo-gallery folder of uploads in FTP into sub-folders. I first uploaded the pictures to WordPress Media then imported them to the photo-gallery folder via the plug-in. From there, I went into FTP and setup folders beneath photo-gallery to organize pictures into an album then galleries individually for organization purposes. Once I did this, I re-added the images into the gallery and the thumbnails would not generate anymore. Is there anyway to resolve this?
Also, the following issues were run into during my attempts:
1. I couldn’t upload images directly to the plug-in or through FTP – only method that worked would be to upload to Media then import to plug-in.
2. The search bar did not function properly when attempting to search for specific pictures. It instead showed the album instead of any pictures with the text in it’s title.
3. The ordering system caused the images to vanish once I tried to organize them in a different way. I disabled this.
Thanks
]]>