站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Custom Queries
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
==背景信息 == === Definitions === === 定义=== In the context of this article, '''query''' refers to the database query that WordPress uses in the Loop to find the list of posts that are to be displayed on the screen ("database query" will be used in this article to refer to generic database queries). By default, the WordPress query searches for posts that belong on the currently-requested page, whether it is a single post, single static page, category archive, date archive, search results, feed, or the main list of blog posts; the query is limited to a certain maximum number of posts (set in the Options admin screens), and the posts are retrieved in reverse-date order (most recent post first). A plugin can use a custom query to override this behavior. Examples: 根据这篇文章的语境,'''查询'''指的是WordPress在Loop中使用的数据库查询,查找界面上显示的文章列表("数据库查询" 在这篇文章中用作一篇的数据库查询)。默认情况下,WordPress查询搜索当前请求的网页上的文章,不管是单篇文章,还是单个的静态网页,类别归档,日期归档,搜索结果,feed,或者博客文章的主要列表;查询限制为最多数目的文章(设置在选项管理界面),文章以日期相反顺序返回(首先是最近的文章)。插件可以使用自定义查询取消这个操作。例如: * Display posts in a different order, such as alphabetically for a "glossary" category. *以不同的顺序显示文章,例如按字母表顺序显示"术语表"类别。 * Override the default number of posts to be displayed on the page; for example, the glossary plugin might want to have a higher post limit when displaying the glossary category. *取消网页上显示的文章的默认数目;如,术语插件显示术语类别的时候,可能想要显示更多的文章。 * Exclude certain posts from certain pages; for example, posts from the glossary category might be excluded from the home page and archive pages, and appear only on their own category page. *从某个网页删除某篇文章;例如,术语类别中的文章可能从主页,归档页面上删除,只出现在自身的类别页面上。 * Expand the default WordPress keyword search (which normally just searches in post title and content) to search in other fields, such as the city, state, and country fields of a geographical tagging plugin. *扩展WordPress默认关键词搜索(一般只在文章标题和内容中搜索),在其它栏中搜索,如地理标题插件中对城市,州,区的搜索。 * Allow custom URLs such as <tt>example.com/blog?geostate=oregon</tt> or <tt>example.com/blog/geostate/oregon</tt> to refer to the archive of posts tagged with the state of Oregon. *允许自定义URLs,如<tt>example.com/blog?geostate=oregon</tt> 或者<tt>example.com/blog/geostate/oregon</tt>指代已标记的文章的归档,标记为俄勒冈州。 === Default WordPress Behavior === === WordPress 默认操作 === Before you try to change the default behavior of queries in WordPress, it is important to understand what WordPress does by default. There is an overview of the process WordPress uses to build your blog pages, and what a plugin can do to modify this behavior, in [[WordPress:Query Overview]]. 在你尝试更改WordPress中的查询的默认操作之前,了解WordPress有那些默认操作,很重要。在[[WordPress:Query Overview|查询概述]]中有个概述,关于WordPress创建你的博客页面的过程,以及可以使用哪个插件来更改这个操作。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)