How To Create My Own Theme in WordPress Part - III (Main Body Section)

The WordPress is made to show the blog. So if you open index file you see

while ( have_posts() ) : the_post();

This is the post loop of WordPress. So in index page you can show blog section of your website. And if you want to show a other Page on Home page then follow this step :


  • Login to Admin Panel
  • Create a Page on your theme folder (Like : home.php)
  • Put This Code into your file :

<?php
/* Template Name: Home */

get_header(); ?>

----- Your Content -----

<?php
get_sidebar();
get_footer();
?>

Before we start you should know about these three function :
get_header() : This function include header.php.
get_sidebar() : This function include sidebar.php.
get_footer() : This function include footer.php.

Design your home page with place of --- Your Content ----


  • Now Create a page in Admin Panel
  • And select Home from Template Drop Down in Right Side box.




  • Now go to Settings Menu
  • Go to Reading Sub Menu
  • Then under "Front Page Displays" Section
  • Check A Static Page Radio Button
  • Then Choose in Front Page Select Box Your Newly Created Page.
  • Click on Save Change Button
Now your customize home page is showing.

If your site have Blog Page Then
Select Post Page Drop down.

Comments