Advertisement
Guest User

page-blog-home.php

a guest
Apr 25th, 2011
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5.     Template Name: Blog Home
  6.  
  7. */
  8.  
  9. ?>
  10.  
  11. <?php get_header(); ?>
  12.    
  13.     <?php query_posts("posts_per_page=5&post_type=post");
  14.    
  15.         // set $more to 0 in order to only get the first part of the post
  16.         global $more;
  17.         $more = 0;
  18.    
  19.     ?>
  20.    
  21.     <div id="blog">
  22.         <div id="article">
  23.             <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
  24.            
  25.             <div <?php post_class('excerpt'); ?> id="post-<?php the_ID(); ?>">
  26.            
  27.                 <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  28.  
  29.                 <h3>Posted on: <?php the_time('F jS, Y'); ?> by <?php the_author(); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments', 'comments-link', ''); ?></h3>
  30.                
  31.                 <div class="entry"> <?php the_content('Read More...'); ?> </div>
  32.                
  33.             </div>
  34.             <?php endwhile; ?>
  35.            
  36.                 <div id="morePrev">
  37.                     <?php next_posts_link('Older Posts'); ?>
  38.                     <?php previous_posts_link('More Recent Posts'); ?>
  39.                 </div>
  40.             <?php else : ?>
  41.                 <p>I'm not sure what you're looking for. </p>
  42.             <?php endif; ?>
  43.         </div> <!-- End Article -->
  44.  
  45.     </div> <!-- End Blog -->
  46.  
  47.     <?php wp_reset_query(); ?>
  48.  
  49. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement