So I'm taking my first foray into creating a wordpress page template. I created a .php file with the following contents:

Template Name: Download Page Template

Then I created a page in the page editor and assigned it to use the "download page template". However, when I preview this page, all I see is the home/index page ... I tried a few of the samples from the codex, but all that happened is that my content from the wp editor showed up at the very bottom of the index page.

Am I missing something obvious?


If the code you posted above is all of your file contents then Yes you are missing something!

you just created a new page template but it's empty, you need to tell WordPress what to display, and usually its done using the loop and a few other template tags add this code to you a.php under what you already have :

//this will include the theme header.php file
<?php get_header(); ?>

<div id="content" class="widecolumn">

 <?php if (have_posts()) : while (have_posts()) : the_post();?>
 <div class="post">
    <h2 id="post-<?php the_ID(); ?>"><?php the_title();?></h2>
    <div class="entrytext">
        <?php the_content(); ?>
 <?php endwhile; endif; ?>
 <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>


//this will include the theme footer.php file
<?php get_footer(); ?>
  • darn, should have mentioned ... I tried precisely this content (from the codex) before I posted here and got the same results :-) in either case, even if it was empty, I would expect an empty screen, not the entire contents of the front page ;-) – Joel Martinez May 11 '11 at 13:00
  • what custom query - if any - are using before the loop in your page template? – Michael May 11 '11 at 17:13
  • none ... whether I use the above mentioned script, or just a blank "template name", it renders the whole front page – Joel Martinez May 11 '11 at 17:26

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.