Title: custom Post Type Dropdown
Last modified: August 20, 2016

---

# custom Post Type Dropdown

 *  [stewd](https://wordpress.org/support/users/stewd/)
 * (@stewd)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-post-type-dropdown/)
 * Hi,
 * I’m trying to create a drop down box that is populated from a certain Custom 
   Post Type,
 * For example
 * I have 20 Courses in the Course Custom post type,
 * And I want them to display in a drop down list somewhere on the site,
 * I Started with displaying categories from all Custom post types,and tried to 
   adapt it to display the Custom post type But It doesn’t return’ anything just
   Multiple Empty Dropdown Boxes.
 * If anyone has done this before and can point me in the right direction it would
   be greatly appreciated
 * Stewart,

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

 *  [phpadam](https://wordpress.org/support/users/phpadam/)
 * (@phpadam)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/custom-post-type-dropdown/#post-2084087)
 * I would like to do the same thing. I’m trying to create a dropdown list of ALL
   the custom posts of a single custom post type. This list will appear in the side
   bar on ONLY posts of that custom post type. I can’t seem to locate any help with
   this.
 * Anyone find something or build something?
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/custom-post-type-dropdown/#post-2084088)
 * Try it with something like this (untested and very simplified):
 *     ```
       <?php
       $mypostype = get_posts('post_type=myproduct');
       if($mypostype) : ?>
       <form action="" id="myform">
       <label for="myselect">Post Types</label>
       <select id="myselect" name="select_post_type">
       <?php foreach ( $mypostype as $mypost  ) : ?>
       <option value="<?php echo $mypost->post_name; ?>"><?php echo $mypost->post_title; ?></option>
       <?php endforeach; ?>
        </select>
       </form>
       <?php endif ?>
       ```
   

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

The topic ‘custom Post Type Dropdown’ is closed to new replies.

## Tags

 * [Post Types](https://wordpress.org/support/topic-tag/post-types/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)

 * 2 replies
 * 3 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/custom-post-type-dropdown/#post-2084088)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
