Title: specific pages
Last modified: August 19, 2016

---

# specific pages

 *  Resolved [ppoivre](https://wordpress.org/support/users/ppoivre/)
 * (@ppoivre)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/)
 * Hi,
 * Can anyone help me to refine this line of code?
 *     ```
       <?php $ids = array();
       query_posts(array('post_type' => 'page'));
       ```
   
 * I would like to add some specific pages to query.
 * I tried
 *     ```
       <?php $ids = array();
       query_posts(array('post_type' => 'page' 'page_id'='329,17,14,6));
       ```
   
 * but it doesn’t work…
 * Can anyone put me on the right track?
 * Thanks in advance,
 * All the best

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

 *  [superiorstudio](https://wordpress.org/support/users/superiorstudio/)
 * (@superiorstudio)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/#post-1244248)
 * Dunno if it is this simple, but you seem to be missing a closing quotation mark
   at the end of the page id numbers.
 *  Thread Starter [ppoivre](https://wordpress.org/support/users/ppoivre/)
 * (@ppoivre)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/#post-1244249)
 * Thanks,
 * It’s logical but it doesn’t resolve the issue… with this code I get a T_CONSTANT_ENCAPSED_STRING
   error…
 * Thanks for helping…
 *  Thread Starter [ppoivre](https://wordpress.org/support/users/ppoivre/)
 * (@ppoivre)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/#post-1244250)
 * if I put that…
 *     ```
       <?php $ids = array();
       query_posts(array('post_type' => 'page', 'page_id'=>329,17,12,7,18));
       ```
   
 * I get only the page id 329 displayed…. the other not !
 * Any idea?
 * Thank you very much
 * All the best
 *  [superiorstudio](https://wordpress.org/support/users/superiorstudio/)
 * (@superiorstudio)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/#post-1244251)
 * Sounds like what used to be called a type mismatch error, where you want the 
   code to understand a number but it is seeing a string. Perhaps throwing an (int)
   in front of your number string as shown here?
 * [http://www.phpf1.com/tutorial/php-string-to-int.html](http://www.phpf1.com/tutorial/php-string-to-int.html)
 *  Thread Starter [ppoivre](https://wordpress.org/support/users/ppoivre/)
 * (@ppoivre)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/#post-1244253)
 * Thanks so much
 * but writing this:
 *     ```
       <?php $ids = array();
       query_posts(array('post_type' => 'page', 'page_id'=> (int)'329,17,12,7,18'));
       ```
   
 * didn’t help…
 * mmmm!
 *  Thread Starter [ppoivre](https://wordpress.org/support/users/ppoivre/)
 * (@ppoivre)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/specific-pages/#post-1244492)
 * This was the answer…
 *     ```
       <?php $ids = array();
       query_posts(array('post_type' => 'page', 'post__in' => array(329,17,19,7)));
       ```
   
 *  [kastaniet](https://wordpress.org/support/users/kastaniet/)
 * (@kastaniet)
 * [16 years ago](https://wordpress.org/support/topic/specific-pages/#post-1244734)
 * Try to find an answer here: [php tutorials](http://phpforms.net/tutorial/tutorial.html).

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

The topic ‘specific pages’ is closed to new replies.

## Tags

 * [get page](https://wordpress.org/support/topic-tag/get-page/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [kastaniet](https://wordpress.org/support/users/kastaniet/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/specific-pages/#post-1244734)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
