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.
This topic contains 5 replies, has 2 voices.
Last updated by gustavoC-15 3 years, 2 months ago.
Assisted by: Dražen.
Author | Posts |
---|---|
July 11, 2022 at 6:55 pm #11645309 | |
gustavoC-15 |
Hi, I’m having an issue when translating posts (post type "post", not a custom post type) and using the custom permalink structure including the main language slug in there as the attachment (/propiedades/%postname%). The problem is that I can’t see the option to translate this slug as it is possible with the custom post types (see attached). How can I do it? Btw, it works great when translating the base category slug ("propiedades/categoria" to "properties/category"). Thanks, |
July 12, 2022 at 7:05 am #11647163 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello Gustavo, for a slug of CPT to be translatable you need to set in the code you are using to use archive and define slug using rewrite. WPML allows has_archive to be set to a string. However, if the string value is set to something other than rewrite['slug'], or the custom post type name slug is not set, the archive slug will not be translatable. Please check the next docs for more info and examples: Hope it helps. Kind regards, |
July 12, 2022 at 11:18 am #11649511 | |
gustavoC-15 |
Hi Drazen, Thanks for your reply. What I need to translate is the slug defined on the custom permalink structure for the native/reserved post type "post”. I haven’t found it on the provided link, how can I do it? Thanks again. |
July 12, 2022 at 12:11 pm #11650163 | |
gustavoC-15 |
Drazen, I have just found this related topic, created 2 years ago: Can you please confirm if there is an approach to sort this on the current version? Thanks, |
July 12, 2022 at 1:10 pm #11651085 | |
Dražen Supporter
Languages: English (English ) Timezone: Europe/Zagreb (GMT+02:00) |
Hello Gustavo. thanks for getting back. I checked further and it seems Custom Structure is not translatable, as it is supposed to be used by tags not strings for translation. You can suggest this for a new feature via our next form and we will consider it: https://wpml.org/suggest-a-new-feature-for-wpml/ As for a solution to your issue, the best and correct way would be to create a new CPT with a translatable slug and then translate it however you need. I hope I was helpful. Don't hesitate to ask if you find any problems along the way, I'll gladly help you. Regards, |
July 12, 2022 at 1:19 pm #11651117 | |
gustavoC-15 |
Got it, so sadly we will need to move all the content to a new CPT. Thanks! |