If you’ve ever had to search custom post types, this function will come in handy:

Then in your template, you just call it like follows: