跳到内容

Shaun's WP Query Shortcode

v1.2

Shaun Scovil · 2012年6月24日 上架

This extensible plugin allows you to run a custom WP_Query using a simple shortcode, then display the results using compatible nested shortcodes.

正在使用
10+
评分
5.0 / 5
累计下载
2,962
最近更新
2012年10月20日
1 条评价需要 WordPress 3.0+已测试到 3.4.2

贡献者

截图

A basic example of how to use this plugin
A basic example of how to use this plugin
Code that can be used as a template to write a compatible plugin
Code that can be used as a template to write a compatible plugin

Written as a platform for plugin developers, this simple-yet-powerful plugin allows you to run a custom WP_Query using shortcode, then display the results any way imaginable using compatible nested shortcodes.

How It Works

Add the following shortcode to any WordPress post or page:

[wpquery orderby="rand"] [wpq_index] [/wpquery]

In the example above, the [wpquery] shortcode performs a WP_Query using orderby=”rand” to display the results in random order. A full list of query parameters can be found here: WP_Query.

Next, the nested [wpq_index] shortcode displays the results of the custom WP_Query as an unordered list of post title links.

Why It Rocks

Written as a platform for plugin developers, this simple-yet-powerful plugin allows developers to write compatible plugins that manipulate the way post data is displayed – without needing to write functions and shortcode parameters to first retrieve the post data.

The [wpq_index] shortcode function included in this plugin is just a simple example of what it can do. Any plugin that performs a WP_Query could be rewrtitten and optimized to work with this plugin, eliminating a lot of unnecessary code.

Best of all, this plugin gives users total control over the WP_Query being performed!

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums