Saturday, December 7, 2013

How to add a php page to Wordpress ?

Wordpress Developer India


Many days ago i wanted to create a custom page for my WordPress blog that will execute my php code in it, whilst remaining a part of the overall site css/theme/design. The php code would make use of 3rd party APIs (so I need to include other php files). so i was wondering that how do I accomplish this? i got the solution which is pretty simple.

Even 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


that's it - you'r done !  isn't is so simple ? :)






Hope you have enjoyed to read this post,
let me know if you have more suitable suggestions.

you might be more interested in Wordpress Theme Customization,Wordpress Customization Services, Freelance Wordpress Developer, PHP Freelancing india, Freelance Wordpress Web Designer,Wordpress Development,WebMasters,Content Management System, wordpress, Wordpress Development, Wordpress Freelancer


Good Day [/ Night] ! Happy Google + ing !

Reactions:

1 comment:

  1. Here is good information and good worker. I am happy to read about add a php page to Wordpress.Thanks for share this worthy information
    Hire Dedicated Resources

    ReplyDelete

Any Questions or Suggestions ?

About

Professional & Experienced Freelance Developer From India, Technologist, Software Engineer, internet marketer and Open Sources Developer with experience in Finance, Telecoms and the Media. Contact Me for freelancing projects.

Enter your email address:

Delivered by FeedBurner

PHP Freelancer India - Google+