假设您乐于接受包含您在"Partly woking:" 标题
Widgets of Posts by Same Categories
http://svn.wp-plugins.org/widgets-of-posts-by-same-categories/trunk/widgets-of-posts-by-same-categories.php
只需要1到2行代码,这取决于您想要如何处理“post没有缩略图”场景。
插件文件的此区域周围。。
<?php
$postslist = get_posts("category=$cat_ID&numberposts=$numberposts&orderby=$orderby&order=$order&exclude=$exclude_posts");
foreach ( $postslist as $post ) :
?>
<li><a href="<?php print get_permalink($post->ID); ?>" title="<?php print get_the_title($post->ID); ?>"><?php print get_the_title($post->ID); ?></a></li>
<?php endforeach; ?>
您所需要添加的是
has_post_thumbnail
codex page.
if( has_post_thumbnail() )
the_post_thumbnail();
例如。。
<?php
$postslist = get_posts("category=$cat_ID&numberposts=$numberposts&orderby=$orderby&order=$order&exclude=$exclude_posts");
foreach ( $postslist as $post ) :
?>
<li>
<?php
if( has_post_thumbnail() )
the_post_thumbnail();
?>
<a href="<?php print get_permalink($post->ID); ?>" title="<?php print get_the_title($post->ID); ?>"><?php print get_the_title($post->ID); ?></a></li>
<?php endforeach; ?>
虽然我想这取决于您希望实现的具体工作方式。。
这有帮助吗?:)