按类别和标签列出wordpress帖子 [英] Lists wordpress posts by category and tag

查看:140
本文介绍了按类别和标签列出wordpress帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在wordpress中生成所有类别名称为X且标签名称为Y的帖子.

I would like to generate all posts that has say a category name of X and a tag name of Y with in wordpress.

 query_posts('cat=X List&tag=Y');

由于我需要重复此列表并仅回显the_title(),因此我在某种程度上可以工作,但不能完全解决.该问题与那个问题非常相似在此处找到,那么提供的解决方案将是理想的,但是没有用.任何帮助将不胜感激,在此先感谢!

I above works to an extent but not fully since I need to repeat this list and just echo the_title(). The problem is very similar to the one found here, the solutions provided there would be ideal but none work. Any help would be appreciated, thanks in advance!

推荐答案

还有一些插件应该可以为您解决问题. 列出类别帖子"使您可以将一行代码放入页面或要列出帖子类别的帖子中.它允许传递多个变量以自定义输出,因此我认为按标签以及类别进行过滤将很容易.如果您有多种类型的页面,可能会节省一些时间,并且仅允许特定页面显示类别.

There are also some plugins out there that should be able to do the trick for you. 'List Category Posts' allows you to just drop in one line of code into the page or post you want listing your category of posts. It allows for multiple variables to be passed through to customize the output, so I would assume it would be easy enough to filter by tags as well as the category. May save you a little time and allow for only particular pages to display categories if you have a variety of types of pages.

这篇关于按类别和标签列出wordpress帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆