I'm using Toolset Access Control with CPTs to create "teaser" content that is readable by guests. My site is bilingual (English and Irish.) The site homepage(s) uses a "Homepage Visitors" Post Group with a "Welcome Content Pages" Content Template displayed for Guests without read permissions. In this case, the Language Switcher displays in the primary navigation menu as expected. See hidden link and hidden link.
Three CPT types are restricted to Guests but their archive pages remain visible. I've also placed a few instances of those CPTs (the "teaser content") in a Post Group called "Welcome Content" to which Guests have read access. Otherwise, CPTs not in the Post Group default to a Login template. Here are some examples of Welcome content that *is* accessible to Guests:
hidden link hidden link hidden link hidden link
Note that translations exist for both the archives page as well as the accessible CPT content. However, the Language Switcher does not display. But, when a guest visits a similar restricted CPT page, the Language Switcher appears as desired:
hidden linkhidden link
Here's another similar and more curious anomaly: The taxonomy page hidden link displays the Language Switcher pointed to hidden link, but the Irish version doesn't display the Language Switcher back to English.
Thank you for contacting WPML support, I'd be happy to help you with this issue.
Can you please let me know if the issue happens when using Toolset Access? If you deactivate this plugin, does the issue persist?
I've tried to replicate this issue on my demo site but do not see that issue. If the issue persists after deactivating Toolset Access, you can try to enable a minimal environment as below and see if it helps.
- Deactivate all plugins except WPML and Toolset
- Switch to a standard theme of WordPress
❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
While checking the debug info, I see that the WordPress Memory Limit is below the requirements. The minimum requirements are 128M, but we do recommend 256M and the debug information of your site shows it set to 40M. Please check this link for more details https://wpml.org/home/minimum-requirements/.
You can increase it by adding the following code in your wp-config.php file, right before the /* That’s all, stop editing! Happy publishing. */ line:
After adding the code you can confirm that the memory was changed correctly from WPML > Support > WordPress > Memory limit.
If not, it could be a compatibility issue. Please install the Toolset Access plugin on the test site I'm providing here. hidden link
With this link, you'll be directly logged in, and see if the issue is replicable on a clean WordPress installation. Please configure WPML, Toolset as they are configured on your site (just the basic configurations needed to replicate the issue are enough). Please also make sure that you are installing the latest version of the plugin. When everything is finished, and you can replicate the problem, please let me know.
The issue is definitely related to Toolset Access. When I disable that plugin, the Language Switcher appears as expected. (See attached screen shot, which I captured while *not* logged in.) Also, when the Toolset Access plugin is activated, and when I log in, the Language Switcher displays for those pages as expected.
I also increased the Memory Limit per your suggestion. (Thank you!) However, that didn't have any visible effect.
Before I go and strip down my site or do a clean install in the sandbox you provided, does the fact that I can make the problem go away if I disable Toolset Access mean there's another debugging strategy for us to explore?
Yes, that means there could be a compatibility issue there and we don't know how this happens. If it is a real issue and can be replicable on the sandbox site, please help us to replicate it then I can escalate it to the development team to fix it as soon as possible.
Long: Thanks again for the link to the sandbox. I've been doing some troubleshooting on my own. The behavior I'm seeing has something to do with the way that I configured my Post Group. I expect to resolve this on my own but need about another day to confirm. Can you keep this open for 1-2 days more in the meantime?