|

How do you create a custom page template in WordPress

This was one hell of a rabbit hole that took me hours due to no programming experience. However i simply followed the directions in this link and hurray i achieved what i wanted. Please note, after uploading the custompage.php file, i used the text editor in my cpanel file manager to add the codes, not ftp.

Step #1: Open a plain text editor on your PC and add this line of code:

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

Change ‘CustomPageMary’ to any name you want. Click to save file and add .php to the end of the file name.

Step #2: Connect to your website using FTP, or go to your cpanel to use the text editor there as i did.

Step #3: On the left hand side, look for public.html folder if you have more than one website. Otherwise locate your website, go to the current theme or child theme folder, look for the /wp-content/themes/ directory and upload the custom theme you created earlier in your notepad to this directory.

Step #4: Log into your website admin dashboard and go to pages to create a new page. On the right hand side of the new page you are creating, look for the ‘template’ checkbox under the page attributes widget. Select the custom template you created, add content to your page and click publish. Thats’ all,

Read more.

Similar Posts

4 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

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