-
AuthorPosts
-
September 5, 2023 at 12:27 am #1418111
PS: still a little problem before cloning the site: I wanted to design the structure of a new set of products that are going to come on the site in some months, so I don’t have to copy them 5 times, but they keep appearing on the site, no matter if I set them on private or on draft. Is there a way that they don’t appear until the pages are ready but still have them on the model to clone or shall I delete them ?
Thank youSeptember 5, 2023 at 6:00 pm #1418190Hi,
I checked your cPanel Administration WordPress, and you can see the database and user for each install by clicking the blue database button:
so you can delete the user and database for these safely, it’s good to check that they are not sharing the database user accounts.
So I would use the option to uninstall and delete the database & user & directory, and then clone the original main install to create your new ones.
I also checked your products but they all look like they are published and none are in draft, please try changing the ones you don’t want to show to draft status, this should make them not visible on the frontend, if they are please let us know which ones and where you are seeing them, such as the “shop page”Best regards,
MikeSeptember 12, 2023 at 10:25 pm #1418946Hi Mike,
I’m having an issue with the clones.
Since we wrote last time, I cloned an italian and a german version and finished refilling the italian version with content. While I was doing that, I realized there were pages I wanted to add, so I added them to the italian subdirectory as well as to the main site.
So now and want to do the german version, and I deleted the first german clone I did to make another with the updates, but the system won’t let me name it /DE like the other one, it sais that the repertory already exists !
(Les erreurs suivantes ont été trouvées : Le répertoire que vous avez saisi existe déjà! Veuillez saisir un autre nom de répertoire).
Can you please check to see what’s happening ?
Thank you very much
Regards,
NatachaSeptember 12, 2023 at 11:28 pm #1418949This reply has been marked as private.September 14, 2023 at 1:27 am #1419104September 14, 2023 at 4:26 pm #1419176Hi Mike,
Thank you very much for your help and your precious explanation. I took note in case it happens again.
So this is solved. I get back to you when I finish filling the subdirectories with content.
Have a wondeerful afternoon,
NatachaSeptember 14, 2023 at 6:48 pm #1419187Hi,
Glad that this helped, we will leave this open to hear back from you.Best regards,
MikeSeptember 25, 2023 at 11:05 pm #1420339Hi Mike,
I am done with thre out of five websites and I need to make them all visible as soon as possible.
Is it possible to link the three subdomains and then add the last two posteriorly, or do they have to be linked all at the same time ?
Thank you for your quick answer and best regards,
NatachaSeptember 26, 2023 at 11:58 am #1420419September 28, 2023 at 2:54 am #1420734Hi Mike,
Thank you for your tip.
I created a new menu named Languages and put the three costum menus inside. But I don’t achieve putting them under the first one like you did, “Lang”. What is “lang” ? It doesn’t exist and doesn’t have an url. Where do I take “lang” from ?
Thank you !
Best regards,
NatachaSeptember 28, 2023 at 2:58 am #1420735PS: I don’t know if it’s correct, but just for info, I created the language menu inside the structure of the French version, my first website existing since last year. Please tell me if I chosed the wrong place.
Thanks.September 28, 2023 at 12:38 pm #1420797Hi,
Sorry my example may have been confusing, I checked your base site and see your language menu:
so this is good if you want to show the language menu in the topbar, to do so choose the menu location:
and then choose to show it in the theme settings:
Or you can add the language menu items to the main menu:
in this case you might wish to add a folder called “lang” or anything you wish to hold all of your language links, this is what I had in mind in my other screenshot
I hope this explains better.Best regards,
MikeSeptember 28, 2023 at 6:46 pm #1420834Hi Mike,
I didn’t find the way to do the folder, so I kept the menu separate and did what you said, and applied to the other two sites. It’s working on all three ! It’s a miracle ¨!
So how do I put the flags now ? I tried the color button in the styles but nothing happens, and by the way I would like to put the flag, a personalized iamge. Could you help me on that one too?
Thank you so much to allow this magic to happen Mike ! You’r an angel !
Best regards,
NatachaSeptember 29, 2023 at 12:08 pm #1420893Hi,
Glad that this helped, I found emoji flags here and added one to each of your menu labels, and this seemes to work good:
Please note that when you add a flag it looks like country code until you save it, but then it looks correct.
Please check and try this on your other sites.Best regards,
MikeSeptember 29, 2023 at 6:54 pm #1420932Hi Mike,
Thank you for your add.
After loooking how it appears, I prefer the simple mention of the languages without colors. So to make it more clear, I wrote the full name of each language.
I have one small question: the new field with the languages draws a white line on top of the header: is it possible to make it invisible ?
Thanks again and have a nice evening
NatachaSeptember 30, 2023 at 11:57 am #1420952Hi,
Try this CSS in your Enfold Theme Options ▸ General Styling ▸ Quick CSS field:#top #header.av_header_transparency #header_meta { border-bottom: none; }
After applying the css, please clear your browser cache and check.
Best regards,
MikeSeptember 30, 2023 at 11:19 pm #1420999All clear !
Your code is great ! Thank you very much !
Kind regards,
NatachaSeptember 30, 2023 at 11:23 pm #1421000Mike,
Is it possible to coordinate the signe pages of the subdirectories ? I make myself clear: if now I’m, say, on Reviews on my english site, and I click on French, I land on the french homepage. Is there a way that I arrive on the french reviews page instead (Evaluations) ? In this way each page leads to the corrispondent page in the other language, like a translation.
Thank you very much for your previous help!
Kind regards,
NatachaOctober 1, 2023 at 1:48 am #1421002Hi,
Yes this is possible and I have made this modification to your site, but in doing so I found that your URLs are not the same across all three sites so you will need to change all pages on all sites to match, and you may not wish to do this, but I added the code so you can decide.
So to test this I added three test pages on these three sites:your french site is your core site with no “FR” in the URL, I know you know this but in the future people will want to know how this works 🙂
Anyways, I disabled your topbar menu and enabled the topbar Enfold Theme Options ▸ Header ▸ Extra Elements ▸ Phone Number or small info text to hold the language switcher shortcode, you can easily switch back to using the topbar menu there if you wish.
This is the shortcode I added:[dynamic_lang_switcher lang="EN"] * [dynamic_lang_switcher lang="IT"] * [dynamic_lang_switcher lang="FR"]
on the frontend it shows the whole language word:
Then I added this code to the end of your child theme functions.php file in Appearance ▸ Editor on all three sites:function dynamic_language_switcher($lang) { // Get the current full URL $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://"; $current_url = $protocol . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; // Base URL without language $base_url = $protocol . 'guidedtour.ch/'; // If the language is French, return the current URL without language segment if (strtoupper($lang) == 'FR') { $path = str_replace($base_url, '', $current_url); $segments = explode('/', trim($path, '/')); if (in_array($segments[0], array('EN', 'IT'))) { array_shift($segments); // Remove the language segment } return $base_url . implode('/', $segments) . '/'; } // Remove the base URL to get just the path $path = str_replace($base_url, '', $current_url); // Split the path into segments $segments = explode('/', trim($path, '/')); // Check if the first segment is a known language code if (in_array($segments[0], array('EN', 'IT'))) { // Replace the existing language code with the desired one $segments[0] = $lang; } else { // If the first segment is not a language code, prepend the desired language code array_unshift($segments, $lang); } // Construct the new URL $new_url = $base_url . implode('/', $segments) . '/'; return $new_url; } function dynamic_language_switcher_shortcode($atts) { // Mapping short language codes to their full word representations $language_names = array( 'EN' => 'English', 'IT' => 'Italian', 'FR' => 'French' ); $atts = shortcode_atts( array( 'lang' => 'EN' ), $atts, 'dynamic_lang_switcher' ); $url = dynamic_language_switcher($atts['lang']); // Display the full word representation, but link to the appropriate URL return '<a href="' . $url . '">' . $language_names[strtoupper($atts['lang'])] . '</a>'; } add_shortcode('dynamic_lang_switcher', 'dynamic_language_switcher_shortcode');
and now you can go to any of those three pages and click the new language switcher and go to the corresponding page in any language.
But unfortunately it looks like all of your other menu items don’t match across your sites.Best regards,
MikeOctober 1, 2023 at 11:53 am #1421009Hi Mike,
First of all, thank you so much for your astonishing intervention ! I am impressed by all these codes.
I have a few questions:
1. is it on the right column navigation of each page in “url, permalien” that I change the url?
2.Changing the url imples that I have to name them all the same, i.e. all in the same language ? Ex. FR: Attractions touristiques; EN: Sightseeing ? If so, how can I keep the keywords for the SEO ?
3. I don’t like the asterisc: is it possible to do it withouth them ?
Thank you for a quick reply: the website is all messed up and I can work till late tonight, but I need it back on track by tomorrow because of job interviews.
Best regards
NatachaOctober 1, 2023 at 1:06 pm #1421010I also that the word appearing in the frontend is alway in english (italian, french, english) in all three sites, whereas I wanted them to appear in the language itself, as it was before (english, français, italiano). Is this possible ?
and another question: is it possible to make the main french site like the others ?
I could change the asteriscs, so “only” four questions remain.October 1, 2023 at 2:57 pm #1421013Hi,
You can remove the asterisc, that was only an example.
As for the URLs and SEO, I’m not a SEO expert so please research this, but I thought of two options, when you use the Classic Editor you can change the URL to something different than the page title, so I’m thinking that you can for example, change all of the “About” pages to use the URL slug of /about so the language switcher will work, and leave the titles in the appropriate language, like this:
you would need to do this for each language.
Or you can use a redirect plugin and manually add your pages and the corresponding page for each language, here is an example from the plugin page:
you would need to do this for each language, but all of these redirects will be “301” and I’m not sure if this is bad for SEO, it may be.
All in all, either of these will be a lot of work, if it was my site I think that I would just use the original menu and assume that if someone landed on the EN site and they really wanted the FR site, that they would be fine with going to the FR homepage. But I probably have not thought about it as much as you have.
I hope this helps.Best regards,
MikeOctober 2, 2023 at 4:01 pm #1421167Dear Mike,
I also agree with you. Too much work.
I deleted everything, but there is a problem on the homepage of the french website, on top it sais Warning: Unterminated comment starting line 2 in /home/hulaslim/public_html/wp-content/themes/enfold-child/functions.php on line 2and on the mobile screen a huge space appears before the slide show.
The english homepage has a smaller slide-show now, surrounded by a white square around.
How can I fix this ?
Thank you and kind regards,
NatachaOctober 2, 2023 at 4:11 pm #1421170Since it said line 2, I deleted the asterisk with the left slash. Now it sais:
Vos modifications de code PHP ont été annulées en raison d’une erreur sur la ligne 2 du fichier wp-content/themes/enfold-child/functions.php. Veuillez la corriger et réessayer d’enregistrer.
syntax error, unexpected ‘*’, expecting end of file
Now the computer view shows a normal situation (hopefully) but the smartphone view still has this message “Warning:…..”, but mentioning line 3.
October 2, 2023 at 7:03 pm #1421191Hi,
I checked all three sites and made the adjustments needed, the white space around the EN site slider looks like was caused by the page being saved as a “Block Editor” page instead of the Advanced Layout Builder that it is, I corrected. Please note that ALB pages should not be edited or saved with the Block Editor.
Please check your sites.Best regards,
MikeOctober 2, 2023 at 10:41 pm #1421208Hi Mike,
Thank you very much for your precious help. I hadn’t realized I saved the page as “block editor”. So that it doesn’t happen again, can you tell me where does one have to click to save a page like a block editor ? Is the block editor what in French is called Default editor ?
Thank you and best regards,
NatachaOctober 3, 2023 at 1:22 am #1421218Hi,
Yes it is also called the default editor, the WordPress default editor has two choices at Enfold Theme Options ▸ Select Your Editor the Classic Editor & the Block Editor, this is the one that you are currently using. I’m just in the Habit of specifying the one used. when I write.
This thread is very long now, and it seems like we have covered creating a multi-language site using sub-directories fairly well now, did you have any more questions on this, or do you feel comfortable if we closed this thread?Best regards,
MikeOctober 3, 2023 at 2:32 am #1421223Hi Mike,
We can certainly close the issue.
But before, can you tell me how to undo the block mentioned by the message “Warning: Unterminated comment starting line 2 in /home/hulaslim/public_html/wp-content/themes/enfold-child/functions.php on line 2” and how to undo the block caused by the saving in the default editor, in case it happens again ?
Thank you
Best regards,
NatachaOctober 3, 2023 at 6:21 pm #1421309Hi,
I believe that I already solved the “line 2” error, at least I don’t see it anymore, I checked all three sites, I solved it by correctly the code on the page.
If you see the editor error again, switch to the Advanced Layout Builder and save the page again, if this doesn’t help you will need to use the page revisions and go back to a version before the last save, so you may lose some of your last edits.
Whenever you open a ALB page and don’t see the ABL toolbar please use the ALB button to switch to it before saving to page.Best regards,
MikeOctober 3, 2023 at 7:00 pm #1421315Hi Mike,
Thank you for the explanation. I noted everything.
And thank you very much for all of your precious help in doing this cloning and language switcher.
With your guidance it was all very easy to do. Now I feel comfortable to translate the other two versions on my own and put them online.
So this never ending issue can now finally be closed.
Thank you, Thank you.
Kind regards,
Natacha -
AuthorPosts
- The topic ‘Enfols multilanguage site using child and parents sub-directories on WP basis’ is closed to new replies.