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 4 replies, has 2 voices.

Last updated by diego-francescoP 5 months, 2 weeks ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
May 6, 2019 at 2:38 pm #3750013

diego-francescoP

I don't understand how to translate the url inserted in the tag <a> </a> under the copyright of the footer, manually inserted in the file footer.php. For example Privacy Policy and Cookie Policy.

In translation strings I can't find them, not even by clicking on "translate strings in the administration area".

I saw in the forum several topic with solution, I tried but none worked. Maybe I'm wrong some step, but I don't understand which one.

Thanks for support,
Diego

May 6, 2019 at 2:41 pm #3750023

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello Diego,

Thanks for writing in! I’m happy to help out.

Before providing any insights on this, I would like to understand how you are inserting those links, so could you please provide a screenshot or if the possible code to show how it's being added.

Look forward to receiving your answers so we can get to the bottom of this issue.

Thanks

May 6, 2019 at 4:20 pm #3751109

diego-francescoP

This is the code in the footer.php file:

div class="copyright">
 <?php
	if (mfn_opts_get('footer-copy')) {
				echo do_shortcode(mfn_opts_get('footer-copy'));
				} else     
            	echo '© '. date( 'Y' ) .' '. get_bloginfo( 'name' ) .' P.I. IT 03754231201 All Rights Reserved </br> <a href="/privacy-policy/" title="Informativa sulla privacy">Privacy Policy</a> - <a href="/cookie-policy/" title="Informativa sui cookie">Cookie Policy</a> - <a href="/pagamenti/" title="Metodi di pagamento">Metodi di pagamento</a> </br><a href="<em><u>hidden link</u></em>" title="Bewable Web Consulting Bologna">Web Agency </a>';
?>
</div>
May 6, 2019 at 4:30 pm #3751149

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello Diego,

You can use an if/else conditional statement and add the links accordingly:

if(ICL_LANGUAGE_CODE == 'en') {
echo '© '. date( 'Y' ) .' '. get_bloginfo( 'name' ) .' P.I. IT 03754231201 All Rights Reserved </br> <a href="/privacy-policy/" title="Informativa sulla privacy">Privacy Policy</a> - <a href="/cookie-policy/" title="Informativa sui cookie">Cookie Policy</a> - <a href="/pagamenti/" title="Metodi di pagamento">Metodi di pagamento</a> </br><a href="<em><u>hidden link</u></em>" title="Bewable Web Consulting Bologna">Web Agency </a>';
} elseif (ICL_LANGUAGE_CODE == 'fr') {
    echo '© '. date( 'Y' ) .' '. get_bloginfo( 'name' ) .' P.I. IT 03754231201 All Rights FR Reserved </br> <a href="/fr/privacy-policy/" title="Informativa sulla privacy">Privacy Policy</a> - <a href="/cookie-policy/" title="Informativa sui cookie">Cookie Policy</a> - <a href="/pagamenti/" title="Metodi di pagamento">Metodi di pagamento</a> </br><a href="<em><u>hidden link</u></em>" title="Bewable Web Consulting Bologna">Web Agency </a>';
}

https://wpml.org/documentation/support/wpml-coding-api/

Let me know if this helps.

Thanks

May 6, 2019 at 5:45 pm #3751565

diego-francescoP

Excellent, it works!
I had already tried an if/elseif statement but it didn't work, it didn't have the ICL_LANGUAGE_CODE constant but another.
I hadn't seen the api documentation, I'm sorry.

Thank you for the support!

Regards,
Diego