[Resolved] Language switcher not opening the correct link
This thread is resolved. Here is a description of the problem and solution.
Problem: The client was experiencing an issue where clicking on the English flag to switch languages redirected to an incorrect URL, changing '/listing/' to '/product/', which resulted in an incorrect page layout. Additionally, there was a problem with listings not being displayed in both languages. Solution: 1. We identified that some translated strings were breaking the URL slug. 2. We removed the problematic translated strings from the WPML String Translation. 3. We advised the client that if they wish to translate URL slugs, they should do so in WPML > Settings > Custom Post Type Translations, not in the string translations. 4. We split the ticket to address the issue of listings not displaying in both languages, which can be followed up here.
Please note that the solution provided might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we recommend opening a new support ticket. We also 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 contact us in the 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.
Hello. I think I have now translated everything fine.
My problem is this.
This is the SI listing ad hidden link
when I click on ENGLISH flag, it says it's gonna take me here hidden link
but instead it takes me here hidden link
So the url should be /listing/ instead the url is /product/
Because of that it does not have the listing layout
Instead of this hidden link
I'm having trouble understanding the current situation. I'm uncertain whether the changes I made to the permalinks may have caused any issues on your website. However, I will make an effort to resolve this for you. Just to confirm, is this the desired format for the URL slugs?
Listings
English - hidden link
Slovenian - hidden link
Products
English - hidden link
Slovenian - hidden link
We apologize for the inconvenience, but in order to proceed with troubleshooting, we kindly request a site snapshot. Alternatively, with your permission, we can create a snapshot on our own.
For this purpose, we typically recommend using the free plugin "Duplicator." If you are already familiar with how Duplicator works ( https://wordpress.org/plugins/duplicator/), please skip the following steps and simply send me the archive file you downloaded.
To assist you further, please follow these instructions:
Watch the Duplicator instructions video: hidden link
If the archive file exceeds 400MB in size, please utilize Duplicator's file filters to exclude the cache, wp-uploads directory, media, and archive files.
Once you have the archive file, please share the link with us. You can use services such as Google Drive, Dropbox, or similar platforms as the snapshot file will likely be large.
Please note that your next reply will be private, visible only to you and me. You can paste the link to the file there. Rest assured that once the issue is resolved, I will delete the local site.
thank you, everything seems to be working great! Would you mind telling me what you did, as I'm always looking to learn something new with WPML?
One other thing:
I added two new listings, one ona SI page and one on EN page. hidden link hidden link
Problem is, EN version shows me both listings (which is great) hidden link
But SI version does not show me EN listing? hidden link
In other words, "Test listing SI" is automaticaly translated to EN version and shows both flags, but "Test listing EN" is not automaticaly translated to SI, therefore showing only one flag. How can I make this work bothways?
New threads created by Kor and linked to this one are listed below:
I'm not sure if you translated the strings in the string translations. For example : listings to oglas. But when I checked, it was translated and it broke the URL permalinks. If you wish to translate the URL slugs, you need to do this in the WPML > Settings > Custom Post Type Translations.
So, I've corrected it for you and this is now fixed.