Title: filter posts
Last modified: August 19, 2016

---

# filter posts

 *  Resolved [boldhand](https://wordpress.org/support/users/boldhand/)
 * (@boldhand)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-posts-1/)
 * Hello,
    I need to add a drop down list with author names, when the user selects
   an author, the posts are filtered to display only the ones related to that author.
 * There is a custom field which has the meta-key ‘Author’ and the value entered
   is the author name.
 * I really appreciate any help.

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

 *  [monkeymynd](https://wordpress.org/support/users/monkeymynd/)
 * (@monkeymynd)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-posts-1/#post-1210849)
 * Check out this link: [http://codex.wordpress.org/Template_Tags/query_posts#Custom_Field_Parameters](http://codex.wordpress.org/Template_Tags/query_posts#Custom_Field_Parameters)
 * **Custom Field Parameters**
 * Retrieve posts (or Pages) based on a custom field key or value.
 *  * meta_key=
    * meta_value= * meta_compare= – operator to test the meta_value
   =, default is ‘=’, with other possible values of ‘!=’, ‘>’, ‘>=’, ‘<‘, or ‘<=’
 * Returns posts with custom fields matching both a key of ‘color’ AND a value of‘
   blue’:
 * > `query_posts('meta_key=color&meta_value=blue');`
 * Returns posts with a custom field key of ‘color’, regardless of the custom field
   value:
 * > `query_posts('meta_key=color');`
 * Returns posts where the custom field value is ‘color’, regardless of the custom
   field key:
 * > `query_posts('meta_value=color');`
 * Returns any Page where the custom field value is ‘green’, regardless of the custom
   field key:
 * > `query_posts('post_type=page&meta_value=green');`
 * Returns both posts and Pages with a custom field key of ‘color’ where the custom
   field value IS NOT EQUAL TO ‘blue’:
 * > `query_posts('post_type=any&meta_key=color&meta_compare=!=&meta_value=blue');`
 * Returns posts with custom field key of ‘miles’ with a custom field value that
   is LESS THAN OR EQUAL TO 22. Note the value 99 will be considered greater than
   100 as the data is stored as strings, not numbers.
 * > `query_posts('meta_key=miles&meta_compare=<=&meta_value=22');`
 *  Thread Starter [boldhand](https://wordpress.org/support/users/boldhand/)
 * (@boldhand)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-posts-1/#post-1210863)
 * Thank you monkeymynd for pointing out using the query_posts, but there is still
   a point that I need to understand.
 * does this mean that i need to create a number of pages equal to the number of
   authors where each page has a different query_posts,
    then make each name in 
   the drop down list point to one of these pages?
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-posts-1/#post-1210886)
 * Easiest thing to do is to figure out how to put [Template_Tags/wp_list_authors](http://codex.wordpress.org/Template_Tags/wp_list_authors)
   in a dropdown, then WordPress will do everything else for you.
 * Related:
    [Stepping Into Template Tags](http://codex.wordpress.org/Stepping_Into_Template_Tags)
   [Stepping Into Templates](http://codex.wordpress.org/Stepping_Into_Templates)
   [Template Hierarchy](http://codex.wordpress.org/Template_Hierarchy) [Author Templates](http://codex.wordpress.org/Author_Templates)
 *  Thread Starter [boldhand](https://wordpress.org/support/users/boldhand/)
 * (@boldhand)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/filter-posts-1/#post-1210991)
 * Thank you MichaelH for you useful links, but when i mentioned author I didn’t
   mean the blog others (users), it could be player names, actor names, artist names…,
   sorry for not being clear.
 * While searching i passed by this
    [http://wordpress.org/support/topic/197405?replies=3](http://wordpress.org/support/topic/197405?replies=3)
 * the solution here is using $_GET commands to refresh the page with the filtered
   posts.
 * I’m not a PHP expert, so can someone assist with this with slightly more details?
   thanks a million:)

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

The topic ‘filter posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [boldhand](https://wordpress.org/support/users/boldhand/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/filter-posts-1/#post-1210991)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
