Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

Wordpress template with options

Hey, all!

I have a question regarding Wordpress templates. I have a site I'm working on that will have several pages with similar forms, but also with slight differences in terms of data submitted on each.

A thought occurred to me that I might be able to make a single template that could be used to create pages, and on each page, the specific fields needed could be added as required. (This would be done in the dashboard, obviously.)

I've googled "wordpress template with options", but I'm not coming up with anything useful yet. Is what I'm trying to do possible? If so, could anyone point me in the right direction? (Also, any advice Zac Gordon?)

Thanks for any help!

2 Answers

Andres Altuve
Andres Altuve
16,274 Points

Hi Ryan,

The easiest way to achieve this is using contact form 7 , this plugin allows you to build custom forms with custom fields, once your form is ready you use a shortcode in your page template, but it wont create a link in the wordpres menu..

The other solution is to create a custom post type, this will create the link in the wordpress menu and then use contact form 7 to feed each page but it would be a 2 step process, first create form in contact form 7, then create the post and feed the post with the shortcode.

The other way around is to create a plugin with some sort of form builder..

Hope this helps.

Ryan Field
Ryan Field
Courses Plus Student 21,242 Points

So, is it not possible to create a template that has an options/settings section that can be different for each individual page created using that template? The information that needs to be submitted requires some pretty specific things to work properly, and I'd rather have complete control, if possible.

Andres Altuve
Andres Altuve
16,274 Points

Yes it can be done, but you need to create a plugin from scratch, check out How to Build a WordPress Plugin in there you will learn how to build options/settings page... All you need is to figure out how to build the forms..

Ryan Field
Ryan Field
Courses Plus Student 21,242 Points

Awesome, I'll take a look at that! Thanks for the help! :)