2021年10月26日

WordPress the_excerpt()截取摘要长度

摘要: WordPress Modify The Excerpt Lenth 用法: the_excerpt()输出当前文章的摘要,并会附上”[…]”,这不是”更多”的链接。如果你没提供一篇文章明确的摘要(后台文章编辑器的可选摘要区域),它将自动摘录文章内容中前55个字作为摘要。而HTML标签和图片都会从摘 阅读全文

posted @ 2021-10-26 12:16 剩余价值 阅读(490) 评论(0) 推荐(0) 编辑

使用 wp_trim_words() 截取限定字数的内容

摘要: WordPress 3.3 新增了一个 wp_trim_words() 函数,专门用来截取限定字数的内容,比如文章、摘要、标题等: <?php echo wp_trim_words( get_the_content(), 100 ); // 文章内容 echo wp_trim_words( get_ 阅读全文

posted @ 2021-10-26 09:09 剩余价值 阅读(116) 评论(0) 推荐(0) 编辑

导航