<?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,经过插件能够创立adsense广告位。 2,能够间接经过工具在网管中心验证网站。 之前站长David...
家喻户晓,wordpress是基于php开发,在apache效劳下运转是最优秀的。然而,国际依然有很多主机上不能提供ap...
咱们都晓得WordPress顺序很弱小,对搜寻引擎优化很敌对,然而有一点可能有些人还不是很分明,关于WordPress这样...
single_cat_title()函数 single_cat_title()函数,日常中咱们很少会用到,但这个函数会给咱们处理很多成绩,...
复制代码代码如下:add_filter( 'wp_handle_upload_prefilter', 'custom_upload_name' ); function custom...
处理方法: 办法一: 修正文件“/wp-includes/pluggable.php”中的wp_set_auth_cookie函数。搜寻...