0
我对WordPress并不是很熟悉,但我一直在努力让我的布局成为主题,所以我可以使用WordPress平台。出于某种原因,我无法使the_post_thumbnail函数正常工作。 所以当使用这种the_post_thumbnail不能与我合作
the_post_thumbnail(array(100,100));
它表明我这个错误
Illegal offset type in
我对WordPress并不是很熟悉,但我一直在努力让我的布局成为主题,所以我可以使用WordPress平台。出于某种原因,我无法使the_post_thumbnail函数正常工作。 所以当使用这种the_post_thumbnail不能与我合作
the_post_thumbnail(array(100,100));
它表明我这个错误
Illegal offset type in
是否启用在functions.php的缩略图?
在你functions.php
,你应该为了增加这使功能的缩略图:
add_theme_support('post-thumbnails');
然后打电话给你的循环内,或里面你while
:
<?php
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,'large', true);
echo $image_url[0];
?>
它将返回频道精选图片网址,然后您可以随时随地呼应$image_url[0]
。