Title: Looping through Custom Posts
Last modified: August 21, 2016

---

# Looping through Custom Posts

 *  Resolved [John Plastow II](https://wordpress.org/support/users/j2trumpet/)
 * (@j2trumpet)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/looping-through-custom-posts/)
 * Is there a URL that gets all the posts of a custom post type like “/wp-json/posts”
   does for regular posts? And is there a way to order by name or change the date
   order from DEC to ASC? Thanks for the help!
 * [https://wordpress.org/plugins/json-rest-api/](https://wordpress.org/plugins/json-rest-api/)

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

 *  Plugin Author [Ryan McCue](https://wordpress.org/support/users/rmccue/)
 * (@rmccue)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/looping-through-custom-posts/#post-5035444)
 * You can pass the `type` parameter to `/posts`:
 *     ```
       GET /wp-json/posts?type=my-type
       ```
   
 *  [pelachile](https://wordpress.org/support/users/pelachile/)
 * (@pelachile)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/looping-through-custom-posts/#post-5035648)
 * I wish that worked. All I get is a bad gateway error.
 * `wp-json/posts?type=ws_menu`
 * Not sure if it is the underscore in the CPT name though.

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

The topic ‘Looping through Custom Posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/json-rest-api_2e3641.svg)
 * [WP REST API (WP API)](https://wordpress.org/plugins/json-rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/json-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-rest-api/reviews/)

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * 2 replies
 * 3 participants
 * Last reply from: [pelachile](https://wordpress.org/support/users/pelachile/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/looping-through-custom-posts/#post-5035648)
 * Status: resolved