Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 高级自定义字段(ACF)不显示缩略图_Image_Wordpress_Thumbnails_Custom Fields_Options Menu - Fatal编程技术网

Image 高级自定义字段(ACF)不显示缩略图

Image 高级自定义字段(ACF)不显示缩略图,image,wordpress,thumbnails,custom-fields,options-menu,Image,Wordpress,Thumbnails,Custom Fields,Options Menu,我在一个页面上有一个图像库,我正在使用高级自定义字段来拉入该图像的缩略图和更大版本。现在,我已经将它设置为两个单独的字段,因此用户必须上传两个单独的图像(缩略图和全尺寸)。我正在尝试设置它,以便用户只需上传一张图像,但当我继续学习示例时,我的缩略图不起作用,但完整的图像仍然起作用。以下是我一直使用的代码: <?php query_posts(array( 'post_type' => 'gallery_images',

我在一个页面上有一个图像库,我正在使用高级自定义字段来拉入该图像的缩略图和更大版本。现在,我已经将它设置为两个单独的字段,因此用户必须上传两个单独的图像(缩略图和全尺寸)。我正在尝试设置它,以便用户只需上传一张图像,但当我继续学习示例时,我的缩略图不起作用,但完整的图像仍然起作用。以下是我一直使用的代码:

<?php query_posts(array(
                'post_type' => 'gallery_images',
                'posts_per_page' => 20,
)); ?>

<?php while (have_posts()) : the_post(); $gallery_images; 

                $attachment_id = get_field('gallery_full');
                $size = "thumbnail"; // (thumbnail, medium, large, full or custom size)
                $image = wp_get_attachment_image_src( $attachment_id, $size );

?>
      <div class="gallery_image_wrap"><a rel="shadowbox[galpage]" href="<?php the_field('gallery_full'); ?>"><img src="<?php echo $image[0]; ?>" /></a></div>                    


<?php endwhile; ?> 
<?php wp_reset_query(); ?>

这是它返回内容的一个示例:

<div class="gallery_image_wrap">
<a href="http://example.com/photo.jpg" rel="shadowbox[galpage]">
<img src=" ">
</a>
</div>

我做错了什么?(另外,我尝试上载一个新图像以查看这是否是一个解决方案,但仍然遇到相同的问题。)

将返回本地文件系统中不存在的缩略图的原始图像。此函数返回一个布尔值,如果使用缩略图,则返回TRUE;如果使用原始缩略图,则返回FALSE

您可以通过以下方式进行检查:

<?php while (have_posts()) : the_post(); $gallery_images; 

                $attachment_id = get_field('gallery_full');
                $size = "thumbnail"; // (thumbnail, medium, large, full or custom size)
                $image = wp_get_attachment_image_src( $attachment_id, $size );
                if(!$image[3]) { echo "Thumbnail not available"; }
?>

这样做之后,Wordpress似乎没有生成缩略图。我尝试将内存限制添加到.htaccess文件,但没有成功。。。还有其他建议吗?
php_value memory_limit 128M