Thursday, October 10, 2013

How to add a php page to Wordpress

 
You don't need to interact with the API, or use a plugin.
First, duplicate post.php or page.php in your theme folder (under /wp-content/themes/themename/).
Rename the new file as templatename.php (where templatename is what you want to call your new template!). Enter the following at the top of the new file:
<?php
/*
Template Name: templatename
*/
?>
You can modify this file (using php) to include other files or whatever you need.
Then create a new page in your wordpress blog, and in the page editing screen you'll see a 'Template' dropdown in the 'Attributes' widget to the right. Select your new template and publish the page.
Your new page will use the php code defined in templatename.php

http://stackoverflow.com/questions/2810124/how-to-add-a-php-page-to-wordpress

No comments:

Post a Comment