A WordPress block plugin that extends the Query Loop block with custom post selection capabilities. Query Picker allows you to handpick a specific post to display, giving you precise control over what content appears.
Query Picker is a lightweight WordPress plugin that adds a helpful variation to the core Query Loop block. Instead of relying on automatic queries based on categories, tags, or other taxonomies, Query Picker lets you manually select exactly which post you want to display. This is perfect for creating curated content collections, featured post sections, or any scenario where you need one specific post.
- Manual Post Selection: Choose a specific post from any post type directly in the block editor
- Query Loop Compatible: Works as a variation of the core Query Loop block, inheriting all its display options
- Block Editor Integration: Seamless integration with the WordPress block editor
- Lightweight: Minimal performance impact with efficient querying
- WordPress 6.6 or higher
- PHP 7.2 or higher
- Edit a page or post in the WordPress block editor
- Add a new block by clicking the + button
- Search for "Query Picker" or find it under the Theme category
- Insert the block into your content
- Select an existing Query Loop block
- In the block toolbar, click the Transform button
- Select Query Picker from the available transformations
- Once you've added the Query Picker block, click on it to reveal the block settings
- In the block sidebar, you'll find the Pick Post section
- Click Select Posts to open the post picker
- Search for and select the posts you want to display
Change the display of the selected Post with a Post Template in the same way. Especially useful to use Patterns (especially Synced Patterns) in your Post Templates.
- Node.js 14.0 or higher
- npm or yarn
- Clone the repository:
git clone https://github.com/twentybellows/query-picker.git
cd query-picker- Install dependencies:
npm installnpm run build- Build the plugin for productionnpm run watch- Start development mode with hot reloadingnpm run lint:js- Lint JavaScript filesnpm run lint:css- Lint CSS filesnpm run format- Format code using WordPress coding standardsnpm run plugin-zip- Create a distributable plugin zip filenpm run plugin-test- Build and test the plugin in a local environmentnpm run start- Start the development environment with wp-envnpm run stop- Stop the development environment
Yes, Query Picker works with all public post types registered in your WordPress installation.
Yes, Query Picker is fully compatible with the Site Editor and can be used in templates and template parts.
Just one. It's for when you just want one post and you want to pick it. There are other options out there that let you choose many (with more complicated controls) that are better for that use-case.
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.
This plugin is licensed under the GPL v2 or later.
Developed by Twenty Bellows