logo

This is an old version of this question!

Return to the current question

$10
WPML echo url that switchs to the corrent url on translation

Hi

I've run into an issue with WMPL plugin.

I have various links hard coded into my theme.


<a href="<?php bloginfo('url'); ?>/riders" title="" class="button white-black pie ">
<?php _e('view the riders page','my theme'); ?>
</a>


If I switch to another language, and then click this button, I get a 404. For example if I was viewing Spanish, the URL would need to be...
<?php bloginfo('url'); ?>/jinetes/?lang=es


But when I switch language, the link does not change.

I read this documentation...

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

...and this bascially says you can only output full a tags, which is not what I'm after. I after just the URL.

I don't want to start messing with my css to accomodate these links by using
<?php icl_link_to_element(10); ?>
I need to just echo the URL string.

Thanks

Josh Cranwell | 01/27/12 at 8:40pm

This is an old version of this question!

Return to the current question