[Resolved] Avada Options not saveable in english version
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was unable to save Avada theme options for different logos on separate language domains (peaceconference.org and friedenskonferenz.info). They encountered an error message and an HTML 400 error code when attempting to change the logo on peaceconference.org. The issue was linked to session sharing across domains and incorrect settings in .htaccess. Solution: 1. Ensure the 'Auto sign-in and sign-out users from all domains' option is enabled under 'WPML > Languages' in the 'Language URL format' section to facilitate session sharing across domains. 2. Resave the permalinks after enabling this option and log out, then log back in from the secondary domain. 3. If translating the logo, use the 'String Translation' to translate the logo image IDs. This involves finding the default and translated image IDs in 'Media > Library', adding them to 'String Translation', and ensuring they are correctly linked. 4. For issues caused by .htaccess settings, such as 'Header set Referrer-Policy "no-referrer"', adjusting or removing these settings may resolve saving issues. 5. To apply specific CSS to translated pages, use the 'lang' attribute selector in your CSS, for example:
html[lang="en"] .logo{ background-color: red; }
If these steps do not resolve your issue or if the solution seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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.
Background of the issue:
I am trying to use Avada on friedenskonferenz.info and peaceconference.org to have different logos on each site. I can change and save the logo on friedenskonferenz.org, but I encounter an issue on peaceconference.org.
Symptoms:
When I try to change the logo on peaceconference.org, I receive an error message: 'There was a problem with your action. Please try again or reload the page.' The console shows that admin-ajax.php gets an HTML 400 code. The hoster indicated that the issue is coming from the application.
Questions:
Why can't I save the Avada options on peaceconference.org?
What causes the HTML 400 error code in admin-ajax.php?
Hello There,
Thanks for reaching out to us. I will try my best to assist you in this matter.
Since you're using the "different domain per language" format, the login session seems to be not carried to the other language domain, which is causing the error. The session and other essential data won't carry over to other domains unless you enable the "Auto sign-in and sign-out users from all domains" option.
Please navigate to "WPML > Languages" and scroll down to the "Language URL format" section. Under the "Different language per domain" option, you will find the option to Auto Sign-in and sign out users from all domains. Kindly check this screenshot(hidden link) for a better understanding.
Once you've enabled that option, make sure to resave the permalinks and log out from the main domain. Then, log in again to ensure that the session is shared across all domains.
Please try and let me know if that helps. If you need further assistance, I will be happy to assist you.
thank you for your answer.
This is exactly the setting I have.
This did work for quite a long time already, but stopped working maybe a view weeks ago with one of the last updates, but I am not sure about when exactly.
Is there a procedure to reset and set this, so that it will work again?
What does work:
When I log in in friedenskonferenz.info and switch over to peaceconference.org, I am automatically logged in there as well.
But saving the avada settings doesn't work.
If you have any idea what I could do to make that work again, that would be great.
If that option is enabled, the session, cookies, and other essential data should transfer seamlessly to the other language domain, preventing any 400-related errors. To reset the configuration, you can follow these steps:
1. Deselect the option and save the changes.
2. Resave the permalinks.
3. Re-enable the option and save the changes again.
4. Resave the permalinks once more.
5. Log out of the site and log back in from the secondary domain.
This process should help resolve any lingering issues.
However, if the purpose is to translate the logo set through the Avada option, will you please try the following steps and check if they help?
1. Go to "Media > Library".
2. Open both the default and translated images, and copy their IDs (you can see the ID in the URL bar).
3. Navigate to "WPML > String Translation".
4. Scroll down and click on "Translate texts in admin screens »".
5. Once the page loads, enter the ID of the default logo image in the search box.
6. If the ID appears in the results, select the string and click on "Add to String Translation".
7. Return to "WPML > String Translation".
8. The ID should now be at the top. Click the "+" icon under the language flag to add a translation.
9. In the translation box, enter the ID of the translated image you copied earlier, then click outside the box to save.
The steps should translate the image ID and display it correctly on the frontend in each language.
Please try and let me know how it goes. If you need further assistance or clarification on any of the steps, please feel free to reach out — I’d be glad to help!
thanks for your help. But I wasn't successful in any ways, unfortunately.
I tried to reset the settings.
The result is now:
- still the same issue, settings not saveable in Avada Options in peaceconference.info
- The startpage (which is a defined single page) is not reachable on the second language.
Whenever I try to reach peaceconference.info it opens friedenskonferenz.info.
I used to have this issue already, then I just resaved the english translation and that fixed the issue. But now it doesn't work.
Please see the attached picture, I rework the english translation, but it doesn't work to fix the redirect from the startpage to the german original.
Any idea to solve this now?
I also tried to use the string translation for the picture.
With ID I only used the number, so in my case it is 5941 translated to 5943.
Correct this way?
Also this doesn't work.
Hi Martin!
Thank you for the update. Sorry for the delay in responding due to the weekend.
As you mentioned experiencing a redirect when trying to access the translated version, I tested the peaceconference.info domain and successfully accessed the English version without any redirection to the German version, friedenskonferenz.info.
The redirection issue might be temporary, possibly caused by cached data or a corrupted permalink structure. If you're still experiencing the problem, please try the following steps:
1. Resave the permalink structure.
2. Clear the caches on your site and browser.
3. Try accessing the site again.
If possible, test it in an incognito window or a different browser.
You're proceeding correctly with translating the ID. Simply search for the default LOGO ID in String Translation. If it appears in the results, add the translation by entering the translated Logo ID. However, the text might be registered as an Admin Screen string. Before searching in String Translation, ensure the string is added by following the steps I provided in my previous response.
Please let me know the update. I'll be happy to help if you need further assistance in this matter.
thanks again for your answer. It seems, that the redirection issue was a browser/cache issue. I still have it on one of my browsers, but all others don't show it.
I guess, the string translation issue won't work, because there is already a different logo setting done in Avada for the 2nd language (english).
So we need to fix the 400 issue.
I tried again your precedure:
- logged in from friedenskonferenz.info
- WPML -> Languages -> language per volume (not sure about the correct English term, i have the German "Sprachen als Verzeichnisse") -> Save
- Settings -> Permalinks -> Save
- WPML -> Languages -> different domain per language -> Save
- Settings -> Permalinks -> Save
- logout
- logged in in peaceconference.info
- Avada -> Options: When I hit the save button I get again "There was a problem with your action. Please try again or reload the page."
aarghh, I found it! Well, I found the reason of the not saveable settings.
There were header settings for security reason in my .htaccess which caused the issue. Especially it was:
"Header set Referrer-Policy "no-referrer""
I removed this setting, but now I have the following situation:
- All Avada options from both sites only refer to the german site.
- Whenever I change a setting in peaceconference.info it will change the behaviour in friedenskonferenz.info but not in peaceconference.info.
Which means, the logo for peaceconference.info can't be changed currently at all.
Any hint what I can do now? I am still stuck here.
Is there a way to apply certain CSS only in the translated page? What is the best strategy for that? Then I could replace the logo there via CSS.
Hi Martin,
I hope youu;re doinng well. Sorry for the delay in responding due to the weekend.
Thank you for the update. I’m glad to hear that you’ve identified the root cause of the issue with saving options.
Regarding the issue with saving the logo, the field where you’re uploading the logo may be configured to synchronize across all languages. This would explain why changing the setting in one language affects the others.
If you need to translate the logo, the best approach is the one I’ve already shared: translating the logo via String Translation. You should find the default logo image ID in the String Translation section. Translating this ID with the corresponding translated logo ID allows you to display a different logo for each language.
This is the most effective method for translating such elements when dealing with theme options or settings.
If you want to apply CSS for each language, you’ll need to use the `lang` attribute selector. Place the `lang` selector first, followed by the CSS class and styling property. Here’s an example for reference:
html[lang="en"] .logo{
background-color: red;
}
Include the language code for the desired language in the' lang' attribute. By inspecting the frontend using your browser's developer tools, you can locate the value of the `lang` attribute in the HTML element. Please refer to the attached screenshot for guidance.
I hope you can understand. Feel free to let me know if you have any other questions or need clarification. I'll be happy to help.