I am new to Wordpress as of last week and am having trouble understanding some things. I have created a plugin that allows for the dynamic creation of multiple pages.

There is one thing that I cannot figure out how to do. I want to display a list of the available templates in a dropdown, so that the user an assign that particular template to the pages they are creating.

Is there a wordpress function built in that allows for this. If not, can anyone guide me towards where to start on this. Thanks in advance.


The available templates are returned by get_page_templates(), which mostly forwards it to current theme's object.

There is also more specialized page_template_dropdown(), which you might be able to use in your form.

| improve this answer | |
  • My hero. Thank you so much. Sorry for not being able to upvote due to insufficient rep. – David Webb Feb 16 '15 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.