內容簡介
這個外掛引入了一些方便的功能來取代 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,但我相信它可以運行在大多數較舊的安裝中。
外掛標籤
開發者團隊
原文外掛簡介
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.
