函数原型
query_posts( array|string $query ): WP_Post[]|int[]
函数描述
Sets up The Loop with query parameters.
是否弃用
未弃用
函数参数
-
$query
array|string
Required - Array or string of WP_Query arguments.
函数返回值
WP_Post[]|int[] Array of post objects or post IDs.
函数位置
File: wp-includes/query.php.
函数源码
query_posts( 'posts_per_page=5' );源码链接
变更日志
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |

