<?php
/*
single page?show current category articles
*/
?>
<?php
if ( is_single() ) :
global $post;
$categories = get_the_category();
foreach ($categories as $category) :
?>
<li class="widget widget_recent_entries" id="<?php $category->term_id;?>-posts">
<h2 class="widgettitle"><?php echo $category->name; ?></h2>
<ul>
<?php
$posts = get_posts('numberposts=5&category='. $category->term_id);
foreach($posts as $post) :
?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endforeach; ?>
</ul>
</li>
<?php
endforeach; endif ; ?>
<?php
/*
end show current category articles
*/
?>
以上就是安达网络工作室关于《WordPress显示当前文章同分类下的文章列表》的一些看法。更多内容请查看本栏目更多内容!
1.增加性能 在function.php中拔出代码 add_theme_support('post-thumbnails'); 拔出之后会在后盾编辑文章的...
本文实例讲述了wordpress调用以后分类下子分类的办法。分享给大家供大家参考。详细剖析如下: 本人没用过wo...
关于日拜访量还不错的WordPress网站来说,一定都会存在很多待审核的渣滓评论,假如要经过WP后盾删除,那几乎...
本文实例讲述了WordPress评论中制止HTML代码显示的办法。分享给大家供大家参考。详细剖析如下: 应用WordPr...
明天发文章时,惊奇的发现文章的ID居然曾经抵达了19了。鉴于我以前折腾Wordpress的经历,我晓得这是Wordpre...
WordPress 现有的备份办法和存在的成绩 关于 WordPress 博客来说,有很多备份的办法,数据库能够间接经过 P...