Title: Custom post type custom query
Last modified: August 21, 2016

---

# Custom post type custom query

 *  [Khaann](https://wordpress.org/support/users/khaann/)
 * (@khaann)
 * [12 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-custom-query/)
 * I am trying to create a custom query (query_posts) from a custom post type as
   follows
 * `query_posts('post_type=articles&posts_per_page=1' );`
 * I have enabled support for custom post types on this by adding the slug to line
   47 of UamAccessHandler.class.php and it works ok for the main query. The problem
   is with this query, if the first post is protected it will just not turn up anything
   for this, whereas i wish it to return the first allowable post (according to 
   the user privileges).
 * Am I missing something obvious?
 * [http://wordpress.org/extend/plugins/user-access-manager/](http://wordpress.org/extend/plugins/user-access-manager/)

The topic ‘Custom post type custom query’ is closed to new replies.

 * ![](https://ps.w.org/user-access-manager/assets/icon.svg?rev=1563783)
 * [User Access Manager](https://wordpress.org/plugins/user-access-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-access-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/user-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-access-manager/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [Khaann](https://wordpress.org/support/users/khaann/)
 * Last activity: [12 years, 12 months ago](https://wordpress.org/support/topic/custom-post-type-custom-query/)
 * Status: not resolved