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

  1. artgeek
    Posted 2 years 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.


  2. artgeek
    Posted 2 years ago #

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

  3. DaveE
    Plugin Author

    Posted 2 years 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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Flexible Posts Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic