Wordpress按类别发布的帖子

Wordpress按类别发布的帖子,wordpress,Wordpress,我正在用Wordpress开发一个网站。我需要的是做一个页面,其中只显示一个特定类别的文章。我该怎么办 例如,页面Javascript只显示带有category Javascript的帖子。我不知道你对PHP有多在行,但你需要创建一个Wordpress模板,它可以从你的类别中查询帖子 您可以在此处阅读归档页面,其中显示您的所有帖子: 在此之前: <?php while ( have_posts() ) : the_post(); ?> 添加此项以将其查询到特定类别: <

我正在用Wordpress开发一个网站。我需要的是做一个页面,其中只显示一个特定类别的文章。我该怎么办


例如,页面Javascript只显示带有category Javascript的帖子。

我不知道你对PHP有多在行,但你需要创建一个Wordpress模板,它可以从你的类别中查询帖子

您可以在此处阅读归档页面,其中显示您的所有帖子:

在此之前:

<?php while ( have_posts() ) : the_post(); ?>

添加此项以将其查询到特定类别:

<?php query_posts('category_name=News'); ?>

其中“新闻”是您的类别名称


<?php query_posts('cat=1'); ?>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<?php the_title();?>

   <?php the_content(); ?>

<?php endwhile; endif; ?>

<?php wp_reset_query(); ?>

You can read more about query_post here http://codex.wordpress.org/Function_Reference/query_posts
你可以在这里阅读更多关于查询帖子的信息http://codex.wordpress.org/Function_Reference/query_posts
这应该内置在Wordpress中。以查看javascript类别中的帖子为例:
http://yourwebsite.com/category/javascript/
。这假设您已打开永久链接。