我需要将两个单词更改为WordPress主题中的阿拉伯语
我需要将“上次更新”和“发布”从下面的代码更改为阿拉伯语的另一个单词。
该代码是“ template-tags.php”文件的一部分,它是WordPress主题文件的一部分,
我刚刚尝试替换单词,但对我不起作用,
它看起来像是这样。 ��”
<?php if ( get_theme_mod('show_post_date', '1') == 1 ) : ?>
<div class="entry-date"><i class="fa fa-clock-o"></i><span >
<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 60) {
echo "Last updated on "; // here
the_modified_time('Y-m-d');
}
else {echo "Posted on "; // here
the_time('Y-m-d');
} ?>
I need to change "Last updated on" and "Posted on" From the code below to another words in arabic.
This code is part of the "template-tags.php" file which is part of the WordPress theme files
I just tried replacing the words but it didn't work for me
It just looks like this"����������"
<?php if ( get_theme_mod('show_post_date', '1') == 1 ) : ?>
<div class="entry-date"><i class="fa fa-clock-o"></i><span >
<?php $u_time = get_the_time('U');
$u_modified_time = get_the_modified_time('U');
if ($u_modified_time >= $u_time + 60) {
echo "Last updated on "; // here
the_modified_time('Y-m-d');
}
else {echo "Posted on "; // here
the_time('Y-m-d');
} ?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
代码似乎没有问题。您可以应用这些更改以查看它是否有效。
使用
htmlentities
请注意,我
添加了自己,它可能与您的代码有所不同,并且仍然继续。
或者,您可以使用
utf8_encode
这样:如果以上不起作用。
您应该检查页面上是否有
utf-8
元。&lt; meta charset =“ utf-8”&gt;
此元应在您的header.php
文件中。如果没有,请添加。如果您完成了所有工作但没有回答,请使用标准的阿拉伯语或波斯字体
There seems to be no problem with the code. You can apply these changes to see if it works.
Using
htmlentities
Notice that I
I added myself, it will probably be different from your code and still continue.
Or you can use
utf8_encode
like this:And if the above did not work.
You should check to see if there is a
UTF-8
meta on your page.<meta charset="utf-8">
This meta should be in yourheader.php
file. If not, add it.If you did all the work but did not answer, use a standard Arabic or Persian font