我为 wordpress 使用插件“Dynamic_Featured_Image”。我可以让图像显示所有默认图像尺寸(全/中/拇指),但我希望它在我的主题中使用自定义添加的尺寸。
<?php
if( class_exists('Dynamic_Featured_Image') )
{
global $dynamic_featured_image;
$featured_images = $dynamic_featured_image->get_featured_images();
$i = 0;
foreach ($featured_images as $row=>$innerArray)
{
$id = $featured_images[$i]['attachment_id'];
$mediumSizedImage = $dynamic_featured_image->get_image_url($id,'conferance');
$caption = $dynamic_featured_image->get_image_caption( $mediumSizedImage );
echo " <li><img src=\"".$mediumSizedImage."\" alt=\"".$caption."\"><div class=\"captionText\">".$caption." </div></li>";
$i++;
}
}
?>
主题支持的拇指是:
add_theme_support( 'post-thumbnails' );
add_image_size( 'conferance', 570, 335, true );
但是当我获取图像时,它仍然是完整的(原始尺寸)。任何线索为什么?