How To Create Pages In WordPress With Custom Coding

Objective

Create a page in WordPress which will show the header, footer, sidebars like the rest of the site, but will allow custom coding in the main body section.

So how to create this WordPress page which will allow custom coding ?

1. Go to the theme folder in wp-content\themes\{your_theme_folder}

2. Create a page with the name custom-page.php

3. Write the following lines of code in custom-page.php

/**
 * Template Name: Custom Template
 * Description: A Page Template for custom coding
 */

get_header(); 
echo "Put the custom coding here"; 
get_sidebar(); 
get_footer(); 

This will create a custom template with name “Custom Template” for your WordPress pages.

4. Log in to WordPress admin.

5. Go to Pages -> Add New

6. In the “Page Attributes” section in the right under “Template” choose option “Custom Template” (Or the name that you have set in custom-page.php)

7. Your custom coding page is ready. Write your custom code in custom-page.php

8. The link to the page can be found beside “Permalink:”

9. Also for ease of navigation you can add the page in the menu.

Hope this will help you to make custom coded PHP pages under WordPress. Happy coding 🙂

1 comment

Leave a comment

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