Query Wrangler
[resolved] Filter posts by author (5 posts)

  1. aleksandrk
    Posted 2 years ago #


    I need to use the plugin to filter posts by author (it's a multi-author site). Is this possible and if so how to do it? or can the functionality be added?

    Thank you,


  2. Jonathan Daggerhart
    Plugin Author

    Posted 2 years ago #

    I've added the author filter to 1.5rc19. It works according to these parameters: http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters .

    Let me know if you run into any issues with it.

  3. aleksandrk
    Posted 2 years ago #

    Hi Jonathan,

    Thank you for the reply and the addition of author parameters to the module. I can see it there. But, I have another question on the matter, is it possible to obtain the author id from the page url? I guess, I can't find the way to introduce dynamic arguments into the query. I am trying to use the widget to automatically generate posts for the author on whose page the user is.

    I am also wandering if it's possible to create query pages dynamically. For example $user/test will create a query page for each user. I am very new to wordpress, so if this is impossible please just let me know.

    Thank you for you help, it is very appreciated,

    Note: This is a second edit to the post since I figured out the 'private' pages question.

  4. Jonathan Daggerhart
    Plugin Author

    Posted 2 years ago #

    Hi alexsandrk,

    What you're describing is a contextual filter. This is on my list, but after exposed filters so it may take me a while to get there.

  5. Jonathan Daggerhart
    Plugin Author

    Posted 2 years ago #


    I think the newest release has a solution you could use for this. It's not in the UI, but it's the ability to override the WP_Query args using the shortcode.

    Assuming you have the query created and it's id is 1, and that you can use PHP in your wordpress widgets, you could; create a new Widget that can use php, get the global $post object, place the query shortcode into the widget, and dynamically alter the arguments with php.

    Resulting in something like this:

    <?php global $post; ?>
    [query id="1" args="author=<?php print $post->post_author; ?>"]

    Just a thought. If you're not too familiar with PHP, this might not be the best approach.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Query Wrangler
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic