Friday, January 30, 2015

How to Add Custom PHP Page in Wordpress





Wordpress is simple open source for create blogging website that based on PHP.Wordpress provide basic functionality for create new blog and add post in that in that add page,category and other information by using some plugin.SO in Wordpress easy to use create any blog and customize layout and design css only with Wordpress backed admin panel called `wp-admin` When you want to customize Wordpress that you must know some knowledge of it and sometimes you have some PHP file and you want to integrate it in Wordpress than it is easy for beginner.here below process for add costume PHP page in Wordpress

  1. Create new php file in your theme directory like 'demo.php' (`/wp-content/themes/themename/`).If you don't know theme name that see running theme on Wp-admin->Appearance->Themes
  2. Open PHP file and enter below code at top of page.
     <?php
     /*
     Template Name: DEMO
     */
     ?>
  3. Create New page from admin and select 'Template' that you created and save that page
See New created page display in Wordpress.Here in PHP file you can put any custom PHP code its display as you coded in fronted.
If you want to put same header as Wordpress theme than add `get_header()` function at top of page.same for footer and sidebar you can use `get_sidebar()` and `get_footer()` function.

No comments :

Post a Comment