Pintsize index.php

index.php

When you click on the Home menu item, WordPress will look for the template file called index.php along with the functions it finds applicable from within functions.php.

The <!– –> tags are HTML comment tags; as used in this example, these tags will not display in web browsers. They serve no purpose other than to annotate the code below. A php command begins with <?php and ends with ?> code.

<!-- Include the code from header.php -->
<?php get_header(); ?>

   <!-- contant box -->
   <div id="content">
 
      <!-- Start the Loop to read the content of the Post. 
         If you have posts, while you have posts, read posts -->
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

         <!-- Give the box a class and ID of the post ID.  -->
         <div <?php post_class() ?> id="post-<?php the_ID(); ?>">

            <!-- Display the Title as a link to the Post's permalink. -->
            <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>

            <!-- Display the date italicized (November 16th, 2009 format). -->
            <div class="meta">
               <em>Posted on:</em> <?php the_time('F jS, Y') ?>
            </div>

            <!-- Display the Post's Content in a div box with a class of entry. -->
            <div class="entry">
               <?php the_content(); ?>
            </div>

         </div>

      <!-- Stop The Loop, no more Posts to display. -->
      <?php endwhile; ?>

         <!-- Give the box a class for styling -->
         <div class="navigation">
	

            <!-- Print a link to the next set of posts -->
            <div class="next-posts">
               <?php next_posts_link('&laquo; Older Entries') ?>
            </div>
	

            <!-- Print a link to the previous set of posts -->
            <div class="prev-posts">
               <?php previous_posts_link('Newer Entries &raquo;') ?>
            </div>


         </div>

      <!-- This "else" part tells what to do if there weren't any Posts found. -->
      <?php else : ?>

         <h2>Not Found</h2>

      <!-- Stop the Loop. -->
      <?php endif; ?>

   <!-- end content div --> 
   </div>

<!-- Include the code from sidebar.php -->
<?php get_sidebar(); ?>

<!-- Include the code from footer.php -->
<?php get_footer(); ?>

Next, page.php

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s