Title: Get post ID parameter for wp_query() function
Last modified: August 19, 2016

---

# Get post ID parameter for wp_query() function

 *  [Zac Gordon](https://wordpress.org/support/users/zgordon/)
 * (@zgordon)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/get-post-id-parameter-for-wp_query-function/)
 * I am wondering how to use wp_query() with a post_id. Does anyone know how to 
   do this?
 * I have tried a few things that don’t work:
 *     ```
       wp_query('post_id=160');
       ```
   
 *     ```
       wp_query('id=160');
       ```
   
 *     ```
       wp_query('id=160');
       ```
   
 * etc. and haven’t been successful.
 * Any ideas? Thanks!

Viewing 1 replies (of 1 total)

 *  Thread Starter [Zac Gordon](https://wordpress.org/support/users/zgordon/)
 * (@zgordon)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/get-post-id-parameter-for-wp_query-function/#post-901576)
 * [Finally](http://www.bestwpthemez.com/wordpress/how-to-display-single-post-contents-in-sidebar-of-wordpress-blog-1128/)!
 * The correct format is this:
    `wp_query('p=160');`
 * I don’t think that I ever would have thought of that. If anyone can find this
   in the documentation, I would love to finally have that page bookmarked…

Viewing 1 replies (of 1 total)

The topic ‘Get post ID parameter for wp_query() function’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Zac Gordon](https://wordpress.org/support/users/zgordon/)
 * Last activity: [17 years, 5 months ago](https://wordpress.org/support/topic/get-post-id-parameter-for-wp_query-function/#post-901576)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
