Hello Readers, I am back after a long time today will give you a short tutorial for the wordpress custom template page.
Firstly remember the changes which would be done are template specific. So if the template changed ,changes are gone.
firstly go into the template folder ie
So for now i m considering the default template for wordpress 3.0 is twentyten. Now create a empty file inside the the twenty ten folder .
Now we have the custom template which do not contain any code. but now you might be thinking where to access this template file . But wait this file wont show up into the wordpress admin area unless u write the following code.
/* Template Name: new template */
now we could say we have a template page installed on to the wordpress current theme . You could write any html code or could copy the content from the page.php and delete the content which you don want to display . So now will add the following code.
<?php /* Template Name: new_template */ get_header();?> <div id="container"> <div id="content" role="main"> This is a custom Template Page <!-- Any HTML Content Here --> </div> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>
As you can see above will give the same look as the other but here you have freedom to write any static or call any php function or any functionality you want to extend to this template or wordpress. So now we have a complete page where we could have our custom page.So now its time to access this new template page. Step1: Got the Pages->Add New Step 2: Select the new template created . As you can see you will get the template page that we created into the combobox. So now do not enter any content into the page just leave blank and select the template page and publish the page. Then from the main menu you could see the menu is created and also the content you have added . Thank you all for reading hope you it could have been a useful article.