【问题标题】:wordpress - posts by categorywordpress - 按类别发布的帖子
【发布时间】:2013-06-06 17:03:35
【问题描述】:

在wordpress中如何在侧边栏中按类别显示帖子?

【问题讨论】:

  • 在这个页面的右侧,有大约20个类似的问题。他们中的大多数都有答案。
  • 尝试了解query_posts() 的可能性。这很简单。

标签: wordpress


【解决方案1】:
  1. 尝试使用此插件将类别帖子列为您的小部件 边栏。

Category Posts Widget

                               [OR]


<?php query_posts('category_name=your-category-name&showposts=5&order=asc'); ?>
<?php while (have_posts()) : the_post(); ?>
<h2 class="head1"><?php the_title(); ?></h2>   
<?php the_content(); ?>
<?php endwhile;?>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    相关资源
    最近更新 更多