【发布时间】:2019-01-24 10:36:02
【问题描述】:
我正在使用动态特色图像并将多个产品图像添加到单个自定义帖子类型名称作为单个产品的产品,但我试图在我的模板中获取这些图像但数组只返回两个尺寸 [thumb ] [完整] 但我需要中等以下是我的代码
<?php
if( class_exists('Dynamic_Featured_Image') ) {
global $dynamic_featured_image;
$featured_images = $dynamic_featured_image->get_featured_images();
foreach($featured_images as $featured_image) {
?>
<a href="<?php echo $featured_image['full'];?>" rel="rings" rev="<?php echo $featured_image['medium'];?>"><img width="60" src="<?php echo $featured_image['full'];?>"/></a>
<?php }
}
?>
正如你们在锚标签 $featured_image['medium'] 中看到的那样,这就是我想要回显这个锚标签的方式,但不幸的是它没有返回中等大小,我需要帮助才能获得中等大小出色地。下面是我得到的数组,你只能清楚地看到 [thumb] 和 [full]。请帮忙
Array
(
[thumb] => http://www.example.com/wp-content/uploads/2014/07/product-1-120x90.jpg
[full] => http://www.example.com/wp-content/uploads/2014/07/product-1.jpg
[attachment_id] => 254
)
【问题讨论】:
-
一个小时内我的问题只被查看了两次没有人查看和回复..
标签: wordpress wordpress-featured-image