====== How to display news Excerpts ====== 显示news的摘要需要用到两个plugins,分别是:List category posts和 Rich Text Excerpts。它们的功能分别是:控制显示news的数量和控制每一条news的摘要的字数。 * Reference:https://wordpress.org/plugins/list-category-posts/ and https://wordpress.org/plugins/rich-text-excerpts/ ===== Rich Text Excerpts ===== * 安装好Rich Text Excerpts 这个plugin之后,post的编辑页面会多了一个写“Excerpt”的地方 * 1.dashboard>postos>add new * {{:course:wordpress_tutorials:how_to_display_news_excerpts:qq20181029-104634.png?600|}} * 2.按照要求填写好post title,此处对应的时候news的标题 * 3.写入news的内容 * 4.在excerpt区域内写入摘要 * {{:course:wordpress_tutorials:how_to_display_news_excerpts:qq20181029-105617.png?600|}} 在Text”形式下可以加入一些html代码来控制摘要字体的颜色,大小等等 ===== List category posts ===== * List category posts是使用[catlist]短代码在帖子或页面中按类别列出帖子,当编辑页面或帖子时,直接在“Text”中插入短代码,帖子将在那里列出。 * {{:course:wordpress_tutorials:how_to_display_news_excerpts:屏幕快照_2018-10-29_11.58.02.png?600|}} * 基本用法是这样的: * {{:course:wordpress_tutorials:how_to_display_news_excerpts:屏幕快照_2018-10-29_16.33.34.png?600|}} * {{:course:wordpress_tutorials:how_to_display_news_excerpts:屏幕快照_2018-10-30_10.08.48.png?600|}} * 要显示每个帖子的摘录使用:[catlist excerpt = yes] * 列出“Dogs”类别的帖子:[catlist name = Dogs] * 更多参数请参考:https://github.com/picandocodigo/List-Category-Posts/wiki