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 thread is resolved. Here is a description of the problem and solution.

Problem: I need to translate a hardcoded link in my theme

Solution: Follow the steps described in our official documentation: https://wpml.org/documentation/support/achieving-wpml-compatibility-for-your-themes-and-plugins/

Relevant Documentation:

This topic contains 8 replies, has 2 voices.

Last updated by Carlos Rojas 4 weeks ago.

Assigned support staff: Carlos Rojas.

Author Posts
September 12, 2019 at 8:59 am #4559589

denisP-14

Hi Suppot Team,

I have an issue about the theme I am using on the website I selected.
I opened a ticket to the Theme developer but he tells me to open here a ticket to WPML support.

The theme I'm running on WP is StyleMix MOTORS
hidden link

this is my 1st ticket I open to the support center of Stylemix:

my webste is multilanguage (english / italian).
Translated with WPML

One question: on the home page I have the "VIEW ALL INVENTORY" button that points
to hidden link and this is right.

In the Italian version, I translated the button label but not the link.
The italian version of this button should point to hidden link
but I not able to do it.

Please can you help me?

********************************

This was the answer:

Please kindly have a look at the following topic from the WPML official web-site, it should solve your request -> https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/hard-coded-theme-links/

********************************
OK, right now I am stuck because I am not able to solve the issue with the topic from the WPML official. I don't understand how and where I should do the fix.

Please, tell me If I have to write some code and where do I have to put the code.

thanks in advance

regards,
denis

September 12, 2019 at 2:54 pm #4562119

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

1.- I would like to request temporary access (wp-admin and FTP) to your site to take better look at the issue. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Our Debugging Procedures

I will be checking various settings in the backend to see if the issue can be resolved. Although I won't be making changes that affect the live site, it is still good practice to backup the site before providing us access. In the event that we do need to debug the site further, I will duplicate the site and work in a separate, local development environment to avoid affecting the live site.

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Kind regards,
Carlos

September 13, 2019 at 12:40 pm #4568671

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Denis,
Thank you very much for the information provided.

I added a XML code to make WPML fetch the shortcode that creates the element that contains the "VIEW ALL INVENTORY" in WPML -> Settings -> Custom XML Configuration tab.

I would like to ask you to edit the homepage in English -> Make a small change and update the Italian translation using the Translation Editor.

Could you tell me if the issue persists?

Regards,
Carlos

September 13, 2019 at 1:13 pm #4568799

denisP-14

Hi Carlos,

You ask me to update the Italian home page.
Ok but the link that is in button, and the button itself is hardcoded in the WP Bakery Element called "STM Featured Boats".

I am not able to see the button and change manually the link.
If you ask me to do this update, I am not able, sorry

Regards
Denis

September 13, 2019 at 2:40 pm #4569525

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Denis,

Please follow this steps:
- Connect to the site via FTP or by using the WP File Manager plugin that I installed on the site -> Go to wp-content/themes/motors/vc_templates/stm_featured_boats.php line 35 and change this code:

<a class="button" href="<?php echo esc_url(stm_get_listing_archive_link()); ?>">

to this code:

<a class="button" href="<?php _e( esc_url(stm_get_listing_archive_link()), 'motors'); ?>">

- Go to WPML -> Themes and plugins localization -> Scan the theme.
- Go to WPML -> String Translation -> Search for the link (hidden link) -> Translate it.

Could you tell me the results of the steps above?

Regards,
Carlos

September 16, 2019 at 6:59 am #4576665

denisP-14

Hi Carlos,

thanks for the "step by step" guide.
I would never been able to do it.

I attach 2 screenshots.
After the scan of the theme, WPML does not find the link that has to be translated.

thanks in advance
Regards,
Denis

September 16, 2019 at 12:50 pm #4580245

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

I Denis,

I made a little fix the code and now the link appears in String Translation (I already translated it)

You could you confirm that the issue is solved now?

Regards,
Carlos

September 16, 2019 at 12:53 pm #4580257

denisP-14

My issue is resolved now. Thank you!

September 16, 2019 at 1:00 pm #4580307

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Denis,

I'm glad to hear that the issue is solved 🙂

Please don't hesitate to contact us if you need our help in the future with WPML. We will be more than happy to help.
Best regards,
Carlos