Title: dynamic query parameters?
Last modified: October 29, 2019

---

# dynamic query parameters?

 *  Resolved [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * (@airdrummer)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/dynamic-query-parameters/)
 * i have a custom page type that i’d like to be able to filter by tag. of course
   `[
   display-posts post_type="shopitem" tag=christmas]` will work, but i’d like to
   do it dynamically, using a pulldown of tags, and generating a url like `https://
   bostoncamerata.org/shop/full-discog/?tag=christmas` rather than hard-coding a
   page for each tag…any ideas?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdynamic-query-parameters%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * (@airdrummer)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/dynamic-query-parameters/#post-12077236)
 * nevermind, i found display_posts_shortcode_args
 *  Thread Starter [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * (@airdrummer)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/dynamic-query-parameters/#post-12114083)
 * well, no so fast:-\ i tried adding a display_posts_shortcode_args filter to another
   website
    [https://letartliveon.com/publishing/titles/?taxonomy=genres&tax_term=nomatch](https://letartliveon.com/publishing/titles/?taxonomy=genres&tax_term=nomatch)
   but it doesn’t work, event tho i’ve also added a filter for be_regex_meta_query_in_dps…
   or can there only b 1 display_posts_shortcode_args?
 *  Thread Starter [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * (@airdrummer)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/dynamic-query-parameters/#post-12114619)
 * ok, i found the problem: inlike tags & categories, a taxonomy query must b built:
 *     ```
       [tax_query] => Array (
       		[0] => Array ( 
       	 		[taxonomy] => genres 
       	 		[field] => slug 
       	 		[terms] => Array ( [0] => bad1 ) 
       	 		[operator] => IN 
        			[include_children] => 1 
       	 		) 
       	 	)
       ```
   
 * tricky…but unfortunately php is not cooperating:-( i can build an array:
 *     ```
       Array ( [taxonomy] => genres 
        	 [field] => slug 
        	 [terms] => Array ( [0] => bad1  ) 
        	 [operator] => IN [include_children] => 1 ) 
       ```
   
 * but the arrays seem to disappear: both [terms] & the enclosing [tax_query]
    show
   empty Arrays:-\
 *  Thread Starter [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * (@airdrummer)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/dynamic-query-parameters/#post-12114844)
 * finally fixed it…php syntax is painful:-\
 * [https://letartliveon.com/publishing/titles/?genre=biography](https://letartliveon.com/publishing/titles/?genre=biography)
 * works…hthelps someone

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

The topic ‘dynamic query parameters?’ is closed to new replies.

 * ![](https://ps.w.org/display-posts-shortcode/assets/icon-256x256.jpg?rev=2940963)
 * [Display Posts - Easy lists, grids, navigation, and more](https://wordpress.org/plugins/display-posts-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/display-posts-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/display-posts-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/display-posts-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/display-posts-shortcode/reviews/)

## Tags

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

 * 4 replies
 * 1 participant
 * Last reply from: [airdrummer](https://wordpress.org/support/users/airdrummer/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/dynamic-query-parameters/#post-12114844)
 * Status: resolved