How to Create a Custom Page in WordPress

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: TechUtilsPageTemplate */ ?>

Once you have added the code, save the page as: blog[template_name].php so it will be blogtechutils.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 TechUtilsPageTemplate but you can call it whatever you like for example, archive, contact, landingpage etc.

Once you have completed editing this file save it and upload it in your theme directory (/wp-content/themes/yourthemedirectory/) where files like single.phpand 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.

Source

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.