wordpress端口更改_如何在WordPress中更改私人和受保护的帖子前缀

wordpress端口更改

Do you find yourself having a lot of private or protected posts? If you do, then you probably notice that WordPress puts either Private: or Protected: in front of the title. Most users could careless about what goes in front, if they are the only one seeing the site. But, if you have a multi-author blog, or a personal blog, you can make things interesting by changing the default prefix.

您是否发现自己有很多私人或受保护的职位? 如果这样做,那么您可能会注意到WordPress在标题前放置了Private:或Protected:。 如果他们是唯一看到该网站的人,则大多数用户可能会忽略前面的内容。 但是,如果您有多作者博客或个人博客,则可以通过更改默认前缀来使事情变得有趣。

For example: if you have a personal blog which your family reads, then you can have all protected posts title say: “Family Only: Post Title Goes Here”.

例如:如果您有一个家人可以阅读的个人博客,那么您可以让所有受保护的帖子标题都说:“仅限家庭:帖子标题在这里”。

In this article, we will show you how easy it is to change the private and protected posts prefix in WordPress.

在本文中,我们将向您展示在WordPress中更改私人和受保护帖子前缀是多么容易。

更改受保护帖子前缀 (Change Protected Posts Prefix)

Simply paste the following code in your theme’s functions.php file

只需将以下代码粘贴到主题的functions.php文件中


function change_protected_title_prefix() {
    return 'Family Only: %s';
}
add_filter('protected_title_format', 'change_protected_title_prefix');

更改私人帖子前缀 (Change Private Post Prefix)

Paste the following code in your theme’s functions.php file:

将以下代码粘贴到主题的functions.php文件中:


function change_private_title_prefix() {
    return 'Editors Only: %s';
}
add_filter('private_title_format', 'change_private_title_prefix');

You don’t have to use the examples we suggested. You can get creative with this. This is just another way you can spice up your blog.

您不必使用我们建议的示例。 您可以借此发挥创意。 这只是为博客增添趣味的另一种方式。

postcard printing, Next Day Flyers. 明信片打印的领导者Next Day Flyers提供给您。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-change-private-and-protected-posts-prefix-in-wordpress/

wordpress端口更改

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值