我有一个自定义帖子类型的特色图片,我试图在 div 中布局。由于某种原因,图像在页面上但在 div 之外。这是我第一次使用特色图片和自定义帖子类型。我错过了什么导致图像在 div 甚至开始之前出现在页面上?
if ($loop->have_posts()) {
$output = '<div class="stories">';
while($loop->have_posts()){
$loop->the_post();
$meta = get_post_meta(get_the_id());
$output .= '
<div class="story" style="float: left; display: block; border: 1px solid #CCC;">
<a href="' . get_permalink() . '">
' . get_the_title() . '</a>
' . the_post_thumbnail("medium") . '
' . get_the_excerpt() . '
</div>
';
}
$output .= "</div>";
} else {
$output = 'No Stories Added Yet.';
}
return $output;
当我查看 HTML 输出时,这是呈现的内容:
<div class="row-fluid ">
<img class="attachment-medium wp-post-image" width="300" height="195" alt="13755721_m" src="http://code2media.net/wp-content/uploads/2013/04/13755721_m-300x195.jpg">
<img class="attachment-medium wp-post-image" width="300" height="240" alt="African-Boy" src="http://code2media.net/wp-content/uploads/2013/05/Snotty-African-Boy-300x240.jpg">
<div class="stories">
<div class="story" style="flost: left; display: block; border: 1px solid #CCC;">
<a href="http://code2media.net/stories/story-2/"> Story 2</a>
Test Content
</div>
<div class="story" style="flost: left; display: block; border: 1px solid #CCC;">
Test Content
</div>