Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to make a theme with an about page and a contact form,

Should I make a custom page meant specifically for it? (the blog is ment for mobile and I'm not looking for most flexibility, the page can be all hard coded but the text) And how would such page be created from the WP-Admin?

share|improve this question
4  
A theme should never contain a contact form. That’s plugin territory. –  toscho Jun 13 '12 at 15:56
1  
This isn't necessarily true. I have a contact form that users can enable with theme options which allows them to input the destination e-mail. –  AndrettiMilas Jun 13 '12 at 21:03
    
@siouxfan45 Technically possible !== makes sense. Users should have a choice. –  toscho Jun 14 '12 at 10:44

1 Answer 1

up vote 3 down vote accepted

If you're building a custom theme, I'd recommend creating custom page templates - one each for an About and a Contact page.

This gives your end users some flexibility. They can define their own page and select your template - so "About" could be used for "About," "About Me," "Our Story," etc. No need to know which page will be used for the about page in advance.

Just define two extra php files in your theme:

  • about-template.php
  • contact-template.php

Then make sure the files include a header that looks something like this:

<?php
/*
Template Name: About Page
*/
?>
... The rest of your regular template file continues below ...

Using Page Templates

One these custom page templates are defined by your theme, there's nothing special you need to do to use them. Just create pages like you normally would within WordPress, but make sure you select the template you want to use from the Page Attributes meta box:

WordPress Page Attributes

This example is from my theme, which defines additional "Archive," "Blog," and "Landing" templates. The Default Template is just what it sounds like, the default page.php template.

share|improve this answer
    
thanx, and how do I activate them from inside wp-admin? –  ilyo Jun 13 '12 at 19:40
1  
See my edit for details. –  EAMann Jun 13 '12 at 19:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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