Create Blank Page for WordPress Blog Using Your Theme Template

There may come a time when you need to create a blank page on your WordPress site that still uses your template’s header, footer and sidebar.  For example, if you incorporate your own custom search from google, you will need to specify a landing page where the search results will be displayed.

You could use WordPress to create a new page, but this has some problems.wordpress logo

  • WordPress tends to add code to the page the you don’t need or want
  • You will need to recreate this file whenever you switch themes or upgrade.
  • You cannot easily control where this file is created.

To avoid these problems we can use some built-in functions to display a blank page that uses your template and gives you greater control of the page’s content.

First, create a new file in the root directory of your blog (the directory that contains ‘wp-blog-header.php’).  Name it whatever makes sense to you but make sure to give it the ‘.php’ extension.  Copy the following into the file you have just created:

Hello!

;
 
<!--?php 
get_footer();
?-->

You can see an example of this page here – http://joe-riggs.com/blog/blank.php.  You can add any valid html or javascript to the section between the php tags and will be displayed.  If you don’t want to display the header, sidebar or footer you can simply comment out or remove that particular line – ie : delete entire  “get_sidebar();” line to remove the sidebar.

24 thoughts on “Create Blank Page for WordPress Blog Using Your Theme Template”

  1. Hi Joe,

    Thanks very much for making this clear!
    Just found it on the WP forum.

    Followed all of your steps, did even create the /blank page that’s a good start-off (for later html).

    Then realised, I was lost in first instance (no idea how to attach this page as template).

    Then found this explanation, you might consider to add to above explanation?

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    Thanks again.

  2. Ok now I’m really confused. I thought the whole point of WP was to enable somebody to easily create pages that are easily editable …?

    I did try to create an easily editable page using “Add Page” but as you said, it included a ton of code from my home page.

    I must be missing something …

  3. I found your post while searching for help in creating a blank page on my blog so that I can easily upload an Amazon aStore. The current settings of my theme prevent the aStore from fully showing up whether I use the inline frame or frameset codes. But unfortunately, I am clueless about even the first step you mention — set up a new file in my blog’s root directory. I have no idea how to do that or even where the root directory is. I’d appreciate your help with this.
    Thanks very much.

  4. Dumb question. I am new to wordpress. There are lot of folders. What exactly is the root directory in my blog? And will this show up in my “page” admin section? Thank you.

  5. Thank you so much for an easy working guide for setting up custom pages in wordpress. I have been trying other guides and none were as clear as yours. Thanks!

    Max

  6. If i delete the line get header it lose his stylesheet. I want to have a blank page only with a login and a google search and some widgets.

    can ou help me?

  7. I’m still learning from you, as I’m making my way to the top as well. I certainly enjoy reading all that is written on your blog.Keep the tips coming. I loved it!

  8. This is the perfect site for anybody who hopes to understand this topic.
    You understand so much its almost hard to argue with you (not that I really would
    want to…HaHa). You definitely put a new spin on a topic that has been
    written about for years. Wonderful stuff, just great!

  9. I was excited to uncover this site. I need to to thank you for your time for this particularly wonderful read!! I definitely savored every bit of it and i also have you bookmarked to see new information in your site.

  10. A motivating discussion is worth comment. I do think that you should write more about this subject matter, it may not be a taboo subject but typically people do not speak about such issues. To the next! Cheers!!

  11. Write more, hats all I have to say. Literally, it seems as though you relied on thee video to make
    your point. You definitely know what youre talking about, why throw away your intelligence on
    just posting videos to your blog when you could be giving us something enlightening to read?

  12. When somee one searches for his vital thing,
    therefore he/she wants to be available that in detail, therefore that thing is maintained over here.

  13. Hello there I am so thrilled I found your web site, I really found you by accident, while I was looking on Askjeeve for something else, Nonetheless I am here now and would just like to
    say thanks a lot for a incredible post and a all round exciting blog (I also
    love the theme/design), I don’t have time to read it all at the moment but I have bookmarked it and also
    included your RSS feeds, so when I have time I will be back to read more,
    Please do keep up the fantastic work.

Comments are closed.