Free Wordpress Blog Setup

How to Create a Custom Page in WordPress

By Editorial Staff in Themes
How to Create a Custom Page in WordPress

Have you wondered how some people have completely different looking pages on their WordPress site or blog. In this tutorial we will show you how you can create a custom page in WordPress using the custom page template snippet. A custom page is helpful if you want to have a page that looks completely different than rest of your blog but still runs on the WordPress CMS. You can also use it as a homepage or a landing page.

To customize the design and edit styling for the page, HTML and CSS knowledge would be helpful.

You will begin creating a custom page by opening a blank file in your text editor and paste the following code at the very top:

<?php /* Template Name: WPBeginnerT1 */ ?>

Once you have added the code, save the page as: blog[templatename].php so it will be blogwpbeginner.php for this example. You can name it any other structure you like as long as it is a php file.

The above code is simply giving your template a name that you will later see that WordPress recognize, so we are calling our template WPBeginnerT1 but you can call it whatever you like for example, archive, contact, landingpage etc.

This page can use all php markups as your other pages can. If you need help you can use our WordPress Theme Cheat Sheet for Beginners. You can start out by calling WordPress header and footer, or you can go completely solo by doing everything in HTML.

If you do not call header.php, then you must make sure to add all the header information such as style.css and others.

Once you have completed editing this file save it and upload it in your theme directory (/wp-content/themes/yourthemedirectory/) where files like single.php and index.php are located.

Next you will need to login to your WordPress admin panel and Add a New Page. Since you have already written down all the text and settings in the php file, simply name the page and leave the content area blank. Look on the right hand side, you will see a box called Attributes below the publish button. Choose the template using the drag down button.

Custom Page Template

Add the Meta Information such as Title, Description and such if you have the SEO Plugin and Publish the page. Now this page will be using the template you specified.

But if you left the option for the content to be dynamic, then you will need to add content via the admin panel.

This is a very helpful tutorial for designers specially when using WordPress as a CMS.

Free Wordpress Blog Setup

Comments

4 Responses to “How to Create a Custom Page in WordPress”
  1. MOMO says:

    Excellent tutorial. cheers guys.

    Momo

  2. Missy says:

    Hi,

    I’m on here now trying to do this. Let me see if I can pull it off.

  3. Marc Shaw says:

    Hey, I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say GREAT blog!…..I”ll be checking in on a regularly now….Keep up the good work! :)

    - Marc Shaw

  4. Frank says:

    freakin phantastic blog! This may be the best project site on the web…

Share Your Opinions

Tell us what you're thinking...
and if you want a pic to show with your comment, then get gravatar!

Please make sure that you have read our Comment Policy.

Due to high volume of request from our readers, we are adding this feature that allows you to stay updated with this post's comments without having to participate in the discussion even though we would love your input as always. Don't worry we hate SPAM just as much as you do, so you will never receive any SPAM messages from our site and that's our promise to you.

Subscribe without commenting