blog.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /*
  3. Template Name: Blog Template
  4. */
  5. ?>
  6. <?php
  7. get_header(); ?>
  8. <div id="main-content" class="main-content inner-wrapper">
  9. <div id="primary" class="content-area">
  10. <div id="content" class="site-content" role="main">
  11. <?php if(have_posts()): ?>
  12. <?php
  13. $temp = $wp_query;
  14. $wp_query= null;
  15. $wp_query = new WP_Query();
  16. $wp_query->query('posts_per_page=5'.'&paged='.$paged);
  17. while ($wp_query->have_posts()) : $wp_query->the_post();
  18. ?>
  19. <a href="<?php the_permalink() ?>"><h2><?php the_title() ?></h2></a>
  20. <?php the_content() ?>
  21. <?php if(is_page() or is_single()): ?>
  22. <?php the_content() ?>
  23. <?php $wp_query = null; $wp_query = $temp;?>
  24. <p class="small">Posted by <a href="<?php the_author_meta('user_url'); ?>"><?php the_author() ?></a> on <?php the_date() ?>, at <?php the_time() ?></p>
  25. <a href="<?php the_permalink() ?>" class="left"><?php the_post_thumbnail('thumbnail'); ?></a>
  26. <?php the_excerpt() ?>
  27. <p><a href="<?php the_permalink() ?>">Read More &rarr;</a></p>
  28. <?php endif ?>
  29. <div class="clear"></div>
  30. <div class="meta"><?php _e("FILED UNDER:"); ?> <?php the_category(',') ?><br />
  31. <?php the_tags(__('TAGGED AS: '), ', ', ''); ?>
  32. <p><?php edit_post_link(__('Edit This')); ?></p>
  33. </div>
  34. <div class="feedback">
  35. <?php wp_link_pages(); ?>
  36. <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
  37. </div>
  38. <?php comments_template(); // Get wp-comments.php template ?>
  39. <hr />
  40. <?php endwhile ?>
  41. <?php endif ?>
  42. <div id="clear"></div>
  43. </div><!-- #content -->
  44. </div><!-- #primary -->
  45. </div><!-- #main-content -->
  46. <?php get_footer(); ?>