[WordPress] 外掛分享: Category Thumbnail Excerpt

首頁外掛目錄 › Category Thumbnail Excerpt
WordPress 外掛 Category Thumbnail Excerpt 的封面圖片
10+
安裝啟用
尚無評分
4208 天前
最後更新
問題解決
WordPress 2.9.0+ v1.0 上架:2014-09-02

內容簡介

為了讓外掛能夠正常運作,下列程式碼必須放置在主題的 function.php 中,以供縮略圖和摘要使用:

add_theme_support( 'post-thumbnails' );

set_post_thumbnail_size( form_option('thumbnail_size_w&&echo=false'), form_option('thumbnail_size_h&&echo=false'), true );

function custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function custom_excerpt_more( $more ) {
return '';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );

您還需要在要顯示在列表中的文章上添加縮略圖。

之後,只需在文章中添加 [getcatlist 1] 鉤子即可(其中 1 是一個類別 ID)。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Category Thumbnail Excerpt」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

These must be in function.php in the theme for the plugin to work for thumbnail and excerpt:
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size( form_option(‘thumbnail_size_w&&echo=false’), form_option(‘thumbnail_size_h&&echo=false’), true );
function custom_excerpt_length( $length ) {
return 20;
}
add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );
function custom_excerpt_more( $more ) {
return ”;
}
add_filter( ‘excerpt_more’, ‘custom_excerpt_more’ );
You’ll also need to add thumbnails to the posts you want visible in the list.
After that, all you need to do is to add the hook [getcatlist 1] (where 1 is a categoy id) to your post.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon