How to display custom post type as a drop-down field in Contact Form 7

Hello, my first post here. Recently I had a client who wanted to show custom post type items as a choice in a Contact Form 7 form. If you think about it it makes a perfect sense.

An example: you have a custom post type Services and on the Contact page visitor can select service from a dropdown field. We will solve this with a custom form tag, functionality built into Contact Form 7. Here is the complete code:

 

References:

https://contactform7.com/2015/01/10/adding-a-custom-form-tag

https://stackoverflow.com/questions/27867260/contact-form-7-and-custom-post-type

Leave a Reply

Your email address will not be published. Required fields are marked *