저는 404 사용자 정의 페이지를 작성하고 있는데 모두 좋지만 WPML을 사용하고 있으므로 문자열을 현지화하고 있습니다. 내 코드의localize a window.location.href
이 난 부분 :
<h4><?php _e('You still can\'t find anything?', 'kslang'); ?></h4>
<h5><?php _e('Well, then you probably should give us a wake up call...', 'kslang'); "\n"?></h5>
<h5><?php _e('but be aware who you\'re waking up!', 'kslang');?></h5>
<h5><?php _e('You\'re sure? Well, then...', 'kslang'); ?></h5>
<form>
<input type="button" value="<?php _e('Contact Us!', 'kslang'); ?>" onClick="window.location.href='http://www.undenk.info/contact-us-today'">
</form>
<h5><?php _e('or try the Site Map Below. You\'re also welcome to check out our related projects!', 'kslang'); ?></h5>
이제 문제는 내
"window.location.href='http://www.undenk.info/contact-us-today'"
이 상대적 언어로 리디렉션되지 않는다는 것이다.
버튼 텍스트와 나머지 문자열과 같이 텍스트를 가져올 때 href 링크를 간단하게 래핑 할 수도 있지만.
이 방법은 효과가 없습니다. 분명히 문제는 더욱 복잡합니다. if/else 문을 사용해야합니까?
올바른 언어로 리디렉션하는 방법을 알고 있습니까? (문자열 번역기에서 href 링크를 번역하기 위해 _e를 사용하려고했지만이 경우 PHP 코드를 삽입하면 내 사이트가 깨지기 때문에 _e와 작동하지 않습니다.)
누군가가 입력 할 수 있기를 바랍니다. ..
OK 내가 CSS 클래스, 을 만든 다음 icl_ 규칙과 연락처 버튼을 추가하려면 다음 코드를 사용하고 , 훨씬 쉽게 해결책을 발견 : 이 잘 작동합니다. window.location.href에 대한 해결책이 아니지만 훨씬 더 좋은 해결 방법 – smileBeda