Title: Filter by metadata?
Last modified: August 21, 2016

---

# Filter by metadata?

 *  Resolved [artgeek](https://wordpress.org/support/users/artgeek/)
 * (@artgeek)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/filter-by-metadata/)
 * I’m using this plugin (which is awesome, btw!), including a custom template, 
   to display a custom post type of special offers in my site’s sidebar. The CPT
   includes a metabox for the offer’s status (i.e., Active/Inactive).
 * I’m wondering if there’s any code I can add to the custom template to further
   filter the widget’s query by the status? I’ve been able to do this successfully
   in other areas of the site (like so: [http://pastebin.com/nGzdrLUK](http://pastebin.com/nGzdrLUK)),
   but I’m unsure if or how to filter a query that’s already been called. I tried
   using pre_get_posts but couldn’t make it work.
 * [http://wordpress.org/plugins/flexible-posts-widget/](http://wordpress.org/plugins/flexible-posts-widget/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [artgeek](https://wordpress.org/support/users/artgeek/)
 * (@artgeek)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/filter-by-metadata/#post-3984973)
 * Sorry, link to pastebin accidentally includes the end parentheses; try this: 
   [http://pastebin.com/nGzdrLUK](http://pastebin.com/nGzdrLUK)
 *  Plugin Author [DaveE](https://wordpress.org/support/users/dpe415/)
 * (@dpe415)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/filter-by-metadata/#post-3985023)
 * Hi artgeek,
 * The current version of the plugin doesn’t allow you to filter or edit the query
   vars. However, I’ve been working on a new version that will allow that.
 * On order to make it work right now, you’d need to edit the query args directly
   in the plugin’s code files: `flexible-posts-widget.php` inside the `widget` function.
 * The new version should be out this week yet. Thanks for using the plugin!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filter by metadata?’ is closed to new replies.

 * ![](https://ps.w.org/flexible-posts-widget/assets/icon-256x256.jpg?rev=984592)
 * [Flexible Posts Widget](https://wordpress.org/plugins/flexible-posts-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/flexible-posts-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/flexible-posts-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/flexible-posts-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flexible-posts-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flexible-posts-widget/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [filter](https://wordpress.org/support/topic-tag/filter/)
 * [metadata](https://wordpress.org/support/topic-tag/metadata/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * 2 replies
 * 2 participants
 * Last reply from: [DaveE](https://wordpress.org/support/users/dpe415/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/filter-by-metadata/#post-3985023)
 * Status: resolved