$excerpt_length = 55;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, '[...]');
$text = implode(' ', $words);
}
$excerpt_length = 3;
$words = explode("\n", $text, $excerpt_length + 1);
if (count($words) > $excerpt_length) {
array_pop($words);
array_push($words, '<p />......<a href="' . get_permalink($post->ID) . '">[浏览全文]</a>');
$text = implode("\n", $words);
}
以上就是安达网络工作室关于《更改WordPress自动生成摘要的方式》的一些看法。更多内容请查看本栏目更多内容!
自从用了阿里云主机,真是没有省心过。 这两天网站CPU天天100+的,过一会就挂了,原来是wp-cron.php文件造成...
get_option() 函数应用技巧 get_option()这个函数,实际上咱们在整合后盾性能的时分常常会用到的一个函数,...
【阐明】 反省以后文章能否置顶。前往值TRUE 或许 FALSE. 【用法】 复制代码代码如下:<?php is_sticky($pos...
WordPress呈现“需求晋级数据库”普通是网站搬家,或许WordPress版本晋级会呈现。普通状况呈现的...
esc_html()(本义 Html) esc_html() 函数用来本义 Html 代码,让 Html 代码不本义。 用法 esc_html( $tex...
明天忽然有个网友留言说博客的Feed挂了,症状如下: Chrome间接关上订阅页面显示如下: This page contain...