Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mpmchugh

    (@mpmchugh)

    I actually tried making a php snippet using the WPML ICL_LANGUAGE_CODE=='' function in an if else statement, but though it works in a template it does not work in a php snipped and just outputs all the unprocessed php and HTML.

    Any idea why it would not work?

    If this worked, it’d be a great work-around to not having WPML translation support.

    if(ICL_LANGUAGE_CODE=='en') {
    	echo '<a href="http://urlhere.com">Request More Information</a>';
    } elseif(ICL_LANGUAGE_CODE=='es') {
    	echo '<a href="http://urlhere.com">Solicitar más información</a>';
    } elseif(ICL_LANGUAGE_CODE=='zh-hans') {
    	echo '<a href="http://urlhere.com">获取更多信息</a>';
    } elseif(ICL_LANGUAGE_CODE=='zh-hant') {
    	echo '<a href="http://urlhere.com">獲取更多資訊</a>';
    }

    Thanks,
    Michael

    Thread Starter mpmchugh

    (@mpmchugh)

    Hmm. it seems the ICL_LANGUAGE_CODE=='' function does not work inside the loop.

    🙁

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WPML Support for localization?’ is closed to new replies.