<?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显示当前文章同分类下的文章列表》的一些看法。更多内容请查看本栏目更多内容!
要害字形容:装置 进程 如何 Wordpress   // 目录 define 文件 WordPress装置前的预备工作,如今咱们来...
明天在装置wordpress3.0.1的时分,写入数据库阶段时呈现了一大片谬误提醒信息: 复制代码代码如下:WordPres...
应用wordpass博客顺序的冤家都晓得他的默许首页是index.php,但是地球人都晓得index.html的太首页可以进步网...
要害字形容:心得 建站 应用 菜鸟 能够 这个 边栏 主题 文章 一个 这一周都在学用wordpress来做独立博...
WordPress 默许给主题开发者的倡议是在文章列表底部提供上下页按钮,所以没有提供间接用在文章列表下的分页...
同get_post_meta()一样,用于前往文章的自定义字段值得一个函数,只不过get_post_custom()函数应用起来更简...