Tutorials, Wordpress

How to create a custom PHP page in WordPress ?

05 February 2018

Do you want to create a custom page in WordPress? You have seen that many WordPress sites have different layouts for different pages. With a custom page, you can have different layout in appearance from regular pages in WordPress. In this article, we will show you how to create a custom page in WordPress.

Creating a Custom Page in WordPress Theme Folder

In your theme folder create PHP file and in the starting of the file put the given code

Template Name: CustomPage 

You can put your desired template name instead of “CustomPage”.

Creating a Custom Page in WordPress Root Directory

When you don’t want to use the template for the theme and want to create PHP file and use it for other purpose rathor than website, you can create a PHP file in root directory and put the given code in it.

    require_once(dirname(__FILE__) . '/wp-config.php');

    // Your WordPress Functions here...
    echo site_url();

Provide you valuable comment so that we can update the blog as per that.

Leave a Comments