Title: [Plugin: Developer&#039;s Custom Fields] Query Custom Post Type
Last modified: August 20, 2016

---

# [Plugin: Developer's Custom Fields] Query Custom Post Type

 *  [jonahcoyote](https://wordpress.org/support/users/jonahcoyote/)
 * (@jonahcoyote)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-query-custom-post-type/)
 * Hi there, thanks for the great plugin first of all!
 * I’m trying to pull in a list of posts for a custom post type and I don’t get 
   anything in my select field. Here’s my code:
 *     ```
       function register_user_fields() {
       	slt_cf_register_box( array(
       		'type'		=> 'user',
       		'title'		=> 'Member Profile Page',
       		'id'		=> 'profile-page-options',
       		'context'	=> 'normal',
       		'priority'	=> 'high',
       		'fields'	=> array(
       			array(
       				'name'			=> 'profile-page',
       				'label'			=> 'Profile Page',
       				'type'			=> 'select',
       				'scope'			=> array( 'administrator', 'editor' ),
       				'capabilities'	=> array( 'edit_posts' )
       			)
       		),
       		'options_type' => 'posts',
       		'options_query' => array(
       			'posts_per_page' => -1,
       			'post_type' => 'member'
       		)
       	));
       }
       add_action('init','register_user_fields');
       ```
   
 * I’ve got a bunch of members added so there are posts there. Am I doing something
   wrong?
 * Thanks,
    Jonah
 * [http://wordpress.org/extend/plugins/developers-custom-fields/](http://wordpress.org/extend/plugins/developers-custom-fields/)

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

 *  Plugin Author [Steve Taylor](https://wordpress.org/support/users/gyrus/)
 * (@gyrus)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-query-custom-post-type/#post-2513862)
 * Hi Jonah, what you need to do is put the `options_type` and `options_query` parameters
   inside the array for the `profile-page` field where they belong! 😉
 * A “box” isn’t really a good term for a group of fields on a user screen, but 
   the plugin started life just handling post meta boxes. But still, when you register
   a box, it’s a group of fields, and each field’s parameters need to be in its 
   array.
 *  Thread Starter [jonahcoyote](https://wordpress.org/support/users/jonahcoyote/)
 * (@jonahcoyote)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-query-custom-post-type/#post-2513956)
 * Hey Steve, thanks for the reply, that makes sense and it now works perfectly!

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

The topic ‘[Plugin: Developer's Custom Fields] Query Custom Post Type’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/developers-custom-fields.svg)
 * [Developer's Custom Fields](https://wordpress.org/plugins/developers-custom-fields/)
 * [Support Threads](https://wordpress.org/support/plugin/developers-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/developers-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/developers-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/developers-custom-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jonahcoyote](https://wordpress.org/support/users/jonahcoyote/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-developers-custom-fields-query-custom-post-type/#post-2513956)
 * Status: not resolved