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.
|February 5, 2019 at 10:22 am #3161244|
I have a custom theme and I'm using Elementor for page content.
The theme template includes some fixed links and I have tried both the wpml_permalink filter and the WP get_permalink() function, both return the same result and it's not correct:
The page slug is translated, so I expect that:
instead I get
Links in menus are mapped correctly, though.
|February 6, 2019 at 9:18 am #3164709|
Languages: English (English )
Timezone: Asia/Kolkata (GMT+05:30)
Welcome to our forum,
I think you are trying to translate the hardcoded links in your theme template, correct me if I'm wrong. We have detailed documentation on how to translate the hardcoded slugs please refer https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/hard-coded-theme-links/
So if you want to translate the link '<a href="/nome-pagina">No Pagin</a>' You need to get the page id of the link and use the filter
// assuming page id of nome-pagina is 3 apply_filters( 'wpml_element_link', 3, 'page');
The above filter will return translated link as <a href="en/page-name">En no pagin</a>
If this is not your case, Can you please clarify with some more information.
Let me know the results, If you need further assistance don't hesitate to write back i will be happy to help you.