Skip Navigation

[Resolved] Create Select Box with Posts from CPT

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by UNC Digital Services 8 years, 8 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#87555

I know this is probably easy, but I'm having a hard time creating a select box that populates with the posts from a custom post type. Can this be done? Can someone point me to some documentation? Thanks!

#87763

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi Jeff,

I think you can create such a select box using Views:

1) create a view filter with selet your custom post type
2) click "View/Edit Meta HTML" button
populates it as a select dropdown menu, like this:

<!-- wpv-loop-start -->
   <select name="my-posts">
      <wpv-loop>
         <option value="[wpv-post-id]">[wpv-post-title]</option>
      </wpv-loop>
   </select>
<!-- wpv-loop-end -->

There isn't documentation for it

#87931

Perfect. Thanks!