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 Martin Davis 5 months, 1 week ago.

Assigned support staff: Dennis.

Author Posts
May 3, 2019 at 3:18 pm #3735953

Martin Davis

Hi Dennis,

I've got a fixed hard coded link in the Flotheme footer.

Looks like this:

© 2016 - %year% IMAGES / VIDEOS BY <a href="/home/and-other-things/about-me/" class="intern-link" target="_self" rel="noopener" title="About me">Martin Davis</a>

The href attribute - /home/and-other-things/about-me/ - is hard coded and won't work for languages other than English.

I found the following document:

https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/hard-coded-theme-links/

So I thought I could use:

© 2016 - %year% IMAGES / VIDEOS BY <?php icl_link_to_element(837); ?>

837 is the ID of the appropriate page.

The <?php icl_link_to_element(837); ?> section just gets commented out (viewing the source text).

So that was probably garbage.

What's the correct syntax?

And how can I add the further elements like:

class="intern-link"

target="_self"

rel="noopener"

In this case the last 2 aren't important (in other cases they might be) but the class attribute makes it look prettier.

Best regards

Martin

May 6, 2019 at 8:21 am #3745785

Dennis
Supporter

Languages: English (English )

Timezone: Asia/Manila (GMT+08:00)

Hi,

You can translate that string from WPML > String Translation under the text domain 'admin_texts_options_flo-lovely2-footer-cp__cn'.

Please see attached image for your reference.

Kind regards,
Dennis

May 6, 2019 at 11:13 am #3747433

Martin Davis

Hi Dennis,

I've now tried to answer this and the answer doesn't appear in the thread (this happened twice before on another thread). Just the message at the top: see screenshot. And the system logs me out each time. Very annoying.

I've written this message to file first so I can copy it into the browser if this happens again.

How did you know it was the string in text domain 'admin_texts_options_flo-lovely2-footer-cp__cn' ?

And how can I find other such strings I'll need to translate?

Best regards

Martin

May 7, 2019 at 2:04 am #3753123

Dennis
Supporter

Languages: English (English )

Timezone: Asia/Manila (GMT+08:00)

Hi,

The strings from the theme settings was stored in wp_options table in the database. To translate those strings I followed this documentation: https://wpml.org/documentation/getting-started-guide/string-translation/#admin_texts

After finding the correct string, tick the checkbox besides and click the 'Apply' button from the bottom of the page. That would register the selected string to String Translation page.

Kind regards,
Dennis

May 7, 2019 at 1:43 pm #3758611

Martin Davis

Hi Dennis,

thanks for this and your help.

If there are still any problems with this I'll open a new ticket.

Best regards

Martin

May 9, 2019 at 8:06 pm #3779213

Martin Davis

Hi Dennis,

I've attached a screen shot.

I don't understand why I can't edit the fields (the German and Spanish).

What am I doing wrong?

Best regards

Martin