[WordPress] 外掛分享: Picture Element Thumbnails

首頁外掛目錄 › Picture Element Thumbnails
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
10+
安裝啟用
尚無評分
3452 天前
最後更新
問題解決
WordPress 4.0+ v1.0.4 上架:2015-06-15

內容簡介

這個外掛引入了一些方便的功能來取代 the_post_thumbnail() 及 get_the_post_thumbnail() 以支援響應式的 picture 元素。使用方式:

get_the_post_picture(
$fallback_image_size,
array(
$breakpoint_1=>$image_size_1,
$breakpoint_2=>$image_size_2
)
[, $id, $atts]
);

例如:

<?php echo get_the_post_picture(
'single-featured-sm',
array(
'(min-width:768px)'=>'single-featured-md',
'(min-width:992px)'=>'single-featured-lg',
'(min-width:1200px)'=>'single-featured'
)
); ?>

儘管說明中最低版本為4.0,但我相信它可以運行在大多數較舊的安裝中。

外掛標籤

開發者團隊

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

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

原文外掛簡介

This plugin introduces a couple of nifty functions to replace the_post_thumbnail() & get_the_post_thumbnail() in exchange for the responsive picture element. Use:
get_the_post_picture(
$fallback_image_size,
array(
$breakpoint_1=>$image_size_1,
$breakpoint_2=>$image_size_2
)
[, $id, $atts]
);

For example:
'single-featured-md',
'(min-width:992px)'=>'single-featured-lg',
'(min-width:1200px)'=>'single-featured'
)
); ?>

While this says 4.0 for minimum version, I would wager it’ll be fine on most older installations.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon