Title: Custom parameters in query_posts
Last modified: August 20, 2016

---

# Custom parameters in query_posts

 *  [Kapil Chugh](https://wordpress.org/support/users/kapilchugh/)
 * (@kapilchugh)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/custom-parameters-in-query_posts/)
 * I want to use custom parameters in query_posts function.
 * For eg.query_posts(‘section_name=xyz’);
 * I have used “query_vars” filter to add custom parameter as given in
    [http://codex.wordpress.org/Custom_Queries](http://codex.wordpress.org/Custom_Queries)
 * but when i try to access value of this variable in “posts_where” filter like 
   this
 *     ```
       add_filter('posts_where', 'my_posts_order_where' );
   
        function my_posts_order_where( $where ) {
         global $wp_query;
         //print_r($wp_query;)It doesn't give value of section_name variable
        }
       ```
   
 * Can someone please suggest me how it cab be done?

The topic ‘Custom parameters in query_posts’ is closed to new replies.

## Tags

 * [custom parameters](https://wordpress.org/support/topic-tag/custom-parameters/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [Kapil Chugh](https://wordpress.org/support/users/kapilchugh/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/custom-parameters-in-query_posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
