我使用以下代码在我的主页上显示帖子。
但我无法打印thumbnails 使用get_the_post_thumbnail($post->ID, \'thumbnail\');
如果您能帮助解决此问题,我们将不胜感激。。
while (have_posts()) : the_post();
$excerpt = get_the_excerpt();
$date = explode(",", get_the_time("F,j,Y", "", "", false));
print(\'
<section class="large-4 columns">
<section class="main_post cbox1">
<section class="post_inner row collapse">\');
print(\'<div class="large-2 columns small-2">
<span class="date_format">
<span class="date_num">\' . $date[1] . \'
</span><br/><span class="date_month">\' . substr($date[0], 0, 3) . \'
</span></span></span>
</span>
</div>\');
print (\'<div class="large-10 columns small-10">\');
the_title(\'<a class="blogroll_title" href="\' . get_permalink() . \'"><h1 class="heading_blog">\', \'</h1></a>\');
print (\'</div>\');
print (\'<!--end post_inner --></section>\');
print (\'<div class="row collapse post_content"><p>\');
if (strlen(get_the_content()) > 100) {
$content = get_the_content();
echo str_replace(\' \', \'<br /><br />\', substr($content, 0, 300)). "....";
echo \'</p><a href=" \' . get_permalink() . \' " class="read_more button button_top button_body_col11 button_radius">Read More</a>\';
echo get_the_post_thumbnail($post->ID, \'thumbnail\'); // post image thumbanails
}
else { the_content(); echo "</p>"; }
**如果我使用
feature image
然后打印两次。谢谢