[WordPress] 外掛分享: Featured Image Column

首頁外掛目錄 › Featured Image Column
WordPress 外掛 Featured Image Column 的封面圖片
2,000+
安裝啟用
★★★★
4.5/5 分(12 則評價)
31 天前
最後更新
問題解決
WordPress 6.2+ PHP 8.0+ v1.2.0 上架:2011-09-13

內容簡介

Featured Image Column 外掛可在文章列表中新增一個顯示特色圖片的欄位,方便使用者快速查看每篇文章的特色圖片,提升管理效率。

【主要功能】
• 在文章列表中新增特色圖片欄位
• 支援自訂預設圖片
• 可過濾 CSS 樣式

外掛標籤

開發者團隊

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

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

原文外掛簡介

As of version 0.2.2 you can select which post types you’d like to have the image column.
It simply adds a column before the title (far left) the show’s the posts featured image if it’s supported and exists.
Want to change the default image? Simply filter you own image by using featured_image_column_default_image
or filter your own CSS by using the featured_image_column_css filter hook.
Example actions/filters
Change thumbnail size
function my_custom_featured_image_size(mixed $size, int $post_id): mixed {
if (in_array($post_id, [1, 5, 23], true)) {
return [65. 65];
}

return $size;
}
add_filter('featured_image_post_thumbnail_size', 'my_custom_featured_image_size', 10, 2);

Add support for a custom default image
function my_custom_featured_image_column_image(string $image, int $post_id): string {
if (in_array($post_id, [1, 5, 23], true)) {
return trailingslashit( get_stylesheet_directory_uri() ) . 'images/featured-image.png';
}

return $image;
}
add_filter('featured_image_column_default_image', 'my_custom_featured_image_column_image', 10, 2);

Remove support for post types Use the featured_image_column_init action hook for your filter.
function frosty_featured_image_column_init_func() {
add_filter('featured_image_column_post_types', 'frosty_featured_image_column_remove_post_types', 11); // Remove
}
add_action('featured_image_column_init', 'frosty_featured_image_column_init_func');

function frosty_featured_image_column_remove_post_types($post_types) {
foreach($post_types as $key => $post_type) {
if ($post_type === 'post-type') // Post type you'd like removed. Ex: 'post' or 'page'
unset($post_types[$key]);
}
return $post_types;
}

For more question please visit https://austin.passy.co

延伸相關外掛

文章
Filter
Mastodon