wordpress更改网址_更改WordPress的摘录长度

wordpress更改网址

The default excerpt length of WordPress is 55 words. Some one like me may want to change the excerpt length.

WordPress默认摘录长度为55个字。 像我这样的人可能想更改摘录的长度。

I like the have a smaller excerpt length for the homepage. WordPress provides a interface for changing the default excerpt length. The method is very simple and easy.

我喜欢首页的摘要长度较短。 WordPress提供了一个用于更改默认摘录长度的界面。 该方法非常简单容易。

Put these codes into the function.php file in the theme directory. I prefer 35 in my blog. It can be changed to any number you like. Or this value can be stored in the options table.

将这些代码放入主题目录中的function.php文件中。 我更喜欢博客中的35。 可以将其更改为您喜欢的任何数字。 或者,该值可以存储在选项表中。

The code:

代码:

// excerpt length
function option_excerpt_length($text){
  return 35;
}

add_filter('excerpt_length', 'option_excerpt_length');

翻译自: https://www.systutorials.com/change-wordpresss-excerpt-length/

wordpress更改网址

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值