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.

Im trying to create a Theme from scratch, its quite challenging, cause im new to WP. I follow this developing process at Teamtreehouse. All is very good, its just, im puzzled with the template file creation.

Its all fine with front-page.php and home.php files, but eventually I want to have as well the: partnership.php, gallery.php, contact_us.php, prices.php files too.

Anyhow, when I created the partnership.php file and linked it to display the Partnership webpage title with testimonials and link to the webpage, I got default index.php to display. I understand that WP will display the index.php if it does not find any other file in the structure, but the files are all in the example.com/wp-content/themes directory. Im working on localhost.

It seems that WP did not recognize the custom template files.

Share your thoughts on this please.

Many Thanks

share|improve this question
    
have you read the Template Hierarchy codex page? –  Milo Jun 20 '13 at 7:07
    
Yes Milo thanks, it is a bit confusing though. I thought I should ask the question here for that, that someone could explain the process in Capital letters :) sorry, as I mentioned im very new to this. Cheers –  Linards Berzins Jun 20 '13 at 7:14

1 Answer 1

up vote 1 down vote accepted

If you want to use custom page templates, yo have to:

  1. Create file for your template.
  2. On beginning of your file add comment defining that this file is custom template file (/* Template Name: One column, no sidebar */).
  3. Manually set that chosen page should use this custom template.

Of course you can also create custom templates for taxonomies, categories, and so on.

Here you can find great image showing how exactly the template to display is chosen by WordPress: http://codex.wordpress.org/Template_Hierarchy

share|improve this answer
    
Thank you Krzysiek Dróżdż, I will have a look at your approach later tonight after work. Cheers –  Linards Berzins Jun 20 '13 at 7:17
    
Hi Krzysiek Dróżdż, i did set up the page manually to use the that template, still nothing, will try to sort out. Thanks. –  Linards Berzins Jun 21 '13 at 10:46
    
Sorted, thank you –  Linards Berzins Jun 21 '13 at 11:39

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.