首页 > 新闻资讯 > 边栏菜单中更换单词

边栏菜单中更换单词

8条评论
标签:
更多

在functions.php中添加这段代码,就可以在边栏菜单中更换单词,比如post换成article。你也可以换成自己喜欢的词。

add_filter(  'gettext',  'change_post_to_article'  );
add_filter(  'ngettext',  'change_post_to_article'  );
function change_post_to_article( $translated ) {
     $translated = str_ireplace(  'Post',  'Article',  $translated );
     return $translated;
}

* 版权声明:作者WordPress啦! 转载请注明出处。

#1
很短小的代码真是有很大的效果哟。
#2
很有用的小经验,收藏!
#3
这个暂时不用
#4
这个不错,可以省很多功夫。
#5
嗯 这个不错 收藏了
#6
呵呵,真是不错呀,学习了
#7
嗯,这个功能不错哦!
#8
我试了一下,很好!

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.