PHP & .Net Codes

Pages

  • Home

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(); ?>
Posted by Kiran at 6:46 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: Wordpress

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2016 (1)
    • ►  January (1)
  • ►  2015 (2)
    • ►  April (1)
    • ►  January (1)
  • ►  2014 (8)
    • ►  August (1)
    • ►  July (1)
    • ►  May (1)
    • ►  April (3)
    • ►  February (1)
    • ►  January (1)
  • ►  2013 (10)
    • ►  October (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (2)
    • ►  February (2)
    • ►  January (3)
  • ▼  2012 (9)
    • ►  October (1)
    • ►  September (3)
    • ▼  August (4)
      • How to add Images search in Nexgen Gallery for wor...
      • How to add multiple Featured Images for each page/...
      • How to change Default Tepmlate in Page Attributes?
      • How to create template page in wordpress
    • ►  February (1)

Total Pageviews

Translate

PHP.net news & announcements

Loading...

WordPress News

Loading...
Watermark theme. Powered by Blogger.