how to show custom post type in multi select
-
i want to show the custom post type links in my custom frontend form to insert post via wp insert post…
i have done it for category but i didnt know how to show custom post type:
example code for category:
<select name="cats[]" required="" id="choices-multiple-remove-button" placeholder="Select Category" multiple> <?php $categories = get_categories( array( 'type' => 'post', 'child_of' => 0, 'parent' => '', 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical'=> 1, 'exclude' => '', 'include' => '', 'number' => '', 'taxonomy' => 'category', 'pad_counts' => false ) ); foreach ( $categories as $category ) : echo '<option value="' . $category->term_id . '">' . $category->name . '</option>'; endforeach; ?></select> </div>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘how to show custom post type in multi select’ is closed to new replies.