【发布时间】:2016-08-10 16:25:01
【问题描述】:
在下面的代码中,我试图提取 post_id = 25 的完全特征图像,但它正在提取不同帖子的新图像。
<?php
$post_ID= 25;
$post_url= get_permalink($post_ID);
$queried_post = get_post($post_ID);
?>
<img class="img-circle" src="<?php
if (has_post_thumbnail($post_ID)) {
the_post_thumbnail('medium');
}
?>"
<h2><a href="<?php get_permalink($post_url) ?>"</a><?php echo $queried_post->post_title; ?></h2>
<p><?php
query_posts('p=25');
if (have_posts()) : while (have_posts()) : the_post();
?>
<div class="entry">
<?php echo substr(get_the_excerpt(), 0, 300); ?><span>[...]</span>
</div>
<?php
endwhile;
endif;
?>
<p><a class="btn btn-default" href="#" role="button" >View details »</a></p>
【问题讨论】:
标签: php wordpress image post featured