PHP & .Net Codes

Pages

▼

Tuesday, August 21, 2012

How to create template page in wordpress

Copy Any previous template page and change the Template Name as per your requirement. For Example: Template Name: Front Page and this new template page will display in the template lists for each new page adding/editing section. Or Create a new page in the theme.. and paste the below code...

<?php
/**
 * Template Name: Front Page
 * Description: A Page Template that adds a sidebar to pages
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */

get_header(); ?>

        <div id="primary">
            <div id="content" role="main">



                <?php while ( have_posts() ) : the_post(); ?>

                    <?php get_template_part( 'content', 'page' ); ?>

                    <?php comments_template( '', true ); ?>

                <?php endwhile; // end of the loop. ?>

            </div><!-- #content -->
        </div><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
Kiran at 6:46 AM
Share

No comments:

Post a Comment

‹
›
Home
View web version
Powered by Blogger.