WordPress.org

Ready to get started?Download WordPress

Forums

Flexible Posts Widget
[resolved] Filter by metadata? (3 posts)

  1. artgeek
    Member
    Posted 12 months ago #

    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), 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/

  2. artgeek
    Member
    Posted 11 months ago #

    Sorry, link to pastebin accidentally includes the end parentheses; try this: http://pastebin.com/nGzdrLUK

  3. DaveE
    Member
    Plugin Author

    Posted 9 months ago #

    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!

Reply

You must log in to post.

About this Plugin

About this Topic