Pintsize page.php

page.php

In our example, when you click on the menu link “Sample Page”, then this is the code that WordPress executes to process that click. It executes the WordPress Loop, adds the title to the page, and displays the content set up in the Page using the Add Pages menu link.

<?php get_header(); ?>
   <div id="content">
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
	 <div class="post" id="post-<?php the_ID(); ?>">
	    <h2><?php the_title(); ?></h2>
            <div class="meta">
               <em>Posted on:</em> <?php the_time('F jS, Y') ?>
            </div>
	    <div class="entry">
		<?php the_content(); ?>
	        <?php wp_link_pages(array('before' => 'Pages: ', 'next_or_number' => 'number')); ?>
	    </div>
         </div>
      <?php endwhile; endif; ?>
   </div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Much of the code in page.php is repeated from index.php, except for the line which is highlighted. This line executes the php function wp_link_pages which displays page links in paginated posts.

Next, single.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