我在使用我制作的这个特色帖子功能时遇到了一些问题。我遇到的问题是,当 query('showposts=1'); 已设置精选帖子不被拾取。但是,当我输入 query(''); sharethis 插件不起作用。任何人都可以帮我解决我可能做错的事情。
<div id="block_feature">
<div id="featured_post" class="post">
<div class="post_inner">
<?php
$featured = new WP_Query();
$featured->query('showposts=1');
while($featured->have_posts()) : $featured->the_post();
//$wp_query->in_the_loop = true; // This line is added so that the_tags('') will work outside the regular loop.
$featured_ID = $post->ID; // We'll store this here so that we know to skip this post in the main loop
?>
<?php if(get_post_meta($post -> ID, 'feature', true)) { ?>
<?php if (get_post_meta($post->ID, 'large_preview', true)) { ?>
<div class="post_image">
<img src="<?php echo get_post_meta($post->ID,'large_preview',true);?>" width=150px; height=150px alt="Featured Post"/>
</div>
<?php } ?>
<div class="excerpt">
<h2><a href="<?php the_permalink();?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<small>on <?php the_time('M d'); ?> in <?php the_category(',');?> tagged <?php the_tags(''); ?></small>
<?php the_excerpt();?>
</div>
<a href="<?php the_permalink(); ?>" class="readMore">Read More</a>
<?php } ?>
<?php endwhile; ?>
</div>
</div>
</div>