Advertisement
catwingz

full text for sticky posts

Dec 9th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php if (have_posts()) : ?>
  2.  
  3. <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
  4. <?php /* If this is a category archive */ if (is_category()) { ?>
  5. <h1><?php single_cat_title(); ?></h1>
  6. <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
  7. <h2>Posts Tagged ‘<?php single_tag_title(); ?>’</h2>
  8.  
  9. <?php if ( ! is_sticky() ) {
  10. the_content();
  11. } else {
  12. the_excerpt();
  13. } ?>
  14.  
  15. <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
  16. <h2>Archive for <?php the_time('F jS, Y'); ?></h2>
  17. <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
  18. <h2>Archive for <?php the_time('F, Y'); ?></h2>
  19. <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
  20. <h2>Archive for <?php the_time('Y'); ?></h2>
  21. <?php /* If this is an author archive */ } elseif (is_author()) { ?>
  22. <h2>Author Archive</h2>
  23. <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
  24. <h2>Blog Archives</h2>
  25. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement