Title: Make $_SERVER[&#039;QUERY_STRING&#039;] specify more than one query string
Last modified: August 24, 2016

---

# Make $_SERVER['QUERY_STRING'] specify more than one query string

 *  [artistbendavis](https://wordpress.org/support/users/artistbendavis/)
 * (@artistbendavis)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/make-_serverquery_string-specify-more-than-one-query-string/)
 * my current code is this:
 * <?php
    if ($_SERVER[‘QUERY_STRING’]== “attachment_id=144”) {echo do_shortcode(‘[
   gallery ids="144,143,133,126,127,125,132,130,128"]‘); } else{echo do_shortcode(‘[
   gallery ids="243,247,250,249,245,241,246,248,244"]‘);} ?>
 * Basically how do i make it say if query string = “attachment_id=144” or “attachment_id143”
   or “attachment_id etc.” do this. The code I have works for that one particular
   attachment but I can’t figure out how to write in more than one.

Viewing 1 replies (of 1 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/make-_serverquery_string-specify-more-than-one-query-string/#post-6019250)
 * Something like this??
 *     ```
       if (in_array ($_GET ['attachment_id'], array (144,143,133,126,127,125,132,130,128)) {
           echo do_shortcode('[gallery ids="144,143,133,126,127,125,132,130,128"]');
       }
       else {
           echo do_shortcode('[gallery ids="243,247,250,249,245,241,246,248,244"]');
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Make $_SERVER['QUERY_STRING'] specify more than one query string’ is 
closed to new replies.

## Tags

 * [attachment](https://wordpress.org/support/topic-tag/attachment/)
 * [code](https://wordpress.org/support/topic-tag/code/)
 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [string](https://wordpress.org/support/topic-tag/string/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/make-_serverquery_string-specify-more-than-one-query-string/#post-6019250)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
