【发布时间】:2019-11-22 12:26:31
【问题描述】:
首先,我想说我对PHP一无所知(这完全不是我的鞋)。我被要求在 Wordpress 主题中制作一些东西,这将翻译按钮中的文本,这取决于网站语言。差异仅在 slug 中可见,所以我假设,我必须以某种方式获取信息是 slug 包含 "en" 或 "de" 并将该信息传递给翻译功能。
问题是,我不知道从哪里开始。我将不胜感激。
<div class="read-more clearfix">
<a class="button post-button" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php esc_html_e('Read more', 'astrid'); ?></a>
</div>
【问题讨论】:
标签: php wordpress button translation