admin管理员组文章数量:1125719
Hi I've been trying to translate a string on my website using the translation function __( and _e and I'm not seeing it working on my site.
for example i have a string on my site
__( 'Show articles', 'my_theme' )
show articles remains as it is as i switch my website to different languages my site is using MLP.
Hi I've been trying to translate a string on my website using the translation function __( and _e and I'm not seeing it working on my site.
for example i have a string on my site
__( 'Show articles', 'my_theme' )
show articles remains as it is as i switch my website to different languages my site is using MLP.
Share Improve this question asked Feb 5, 2024 at 10:57 Dev LadyDev Lady 1 2 |1 Answer
Reset to default 0Confirm that the translation functions are being loaded. Sometimes, issues with function loading can prevent translations from working.
Basic example of loading translations in your theme's functions.php
file
function my_theme_load_textdomain() {
load_theme_textdomain( 'my_theme', get_template_directory() . '/languages' );
}
add_action( 'after_setup_theme', 'my_theme_load_textdomain' );
本文标签:
版权声明:本文标题:multisite - WordPress Translation not working for my theme 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736663618a1946545.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
.pot
file? – Tony Djukic Commented Feb 5, 2024 at 16:35