WordPress.org

Ready to get started?Download WordPress

Forums

How to add a filter to only show certain authors. (2 posts)

  1. hughmanwho
    Member
    Posted 3 years ago #

    Hello,

    My company is trying to add a way of filtering posts so that you can see only posts from certain authors, certain dates, etc.

    Right now what I have working is that within the loop I am checking every time to see if it is the correct person.. the problem is that if I start with 20 posts and filter out only the ones that match certain criteria then I end up with only a few or possibly even none that match.

    Any thoughts as to a better way to do it? I'm guessing that using wp_query might be helpful but not sure where to put it.

    Thanks!

  2. Jerry
    Member
    Posted 3 years ago #

    Are you thinking more along the lines of like a custom page or something? Take the authors pages for instance, it pulls posts specifically form that one author.

    However, if you have a single custom page and want multiple content filters like say one section of the page would pull posts from Jane Doe, and another section would pull content from 01/01/2000 - 01/02/2011 then you would need two WP_Query calls.

    More info on WP_Query() »

Topic Closed

This topic has been closed to new replies.

About this Topic