My Wordpress Archives Page


/ Published in: PHP
Save to your folder(s)

The code for my wordpress Archives page, there have been a few people who asked how I did it.


Copy this code and paste it in your HTML
  1. <?php get_header(); ?>
  2. <div class="column span-5 first">
  3. <div class="archive-info">
  4. <p>You are browsing the <?php bloginfo('name'); ?> archives for
  5. <?php if (is_category()) { ?>the category <em>'<?php echo single_cat_title(); ?>'</em>
  6. <?php } elseif (is_month()) { ?>the month <em>'<?php the_time('F Y'); ?>'</em>
  7. <?php } elseif (is_year()) { ?>the year <em>'<?php the_time('Y'); ?>'</em>
  8. <?php } elseif (is_tag()) { ?>the tag <em>'<?php single_tag_title(); ?>'</em>
  9. <?php } ?>.
  10.  
  11. Posts from both the <a href="/category/notebook/">Notebook</a> and <a href="/category/photography/">Photoblog</a> are divided to help you find what you're looking for.
  12. </p>
  13. </div>
  14. <div class="navigation arch">
  15. <div class="clear"></div>
  16. <div class="alignleft">
  17. <?php next_posts_link('&laquo; Previous') ?>
  18. </div>
  19. <div class="alignright">
  20. <?php previous_posts_link('Next &raquo;') ?>
  21. </div>
  22. </div>
  23. <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Archives') ) : endif; ?>
  24. </div>
  25. <?php if ( !is_category('6') ) : ?>
  26. <div class="column <?php if ( !is_category('8') ) : ?>span-8<?php else : ?>span-19 last<?php endif; ?>">
  27. <div class="content">
  28. <?php if (have_posts()) : ?>
  29. <h2 class="category_page">Photos</h2>
  30. <?php $i = 1; ?>
  31. <?php while (have_posts()) : the_post(); ?>
  32. <?php if ( in_category('8') ): ?>
  33. <div class="archive-post <?php if ( !is_category('8') ) : ?>a<?php echo $i; endif?>" id="post-<?php the_ID(); ?>">
  34. <?php if ($post->image): ?>
  35. <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
  36. <img src="<?php echo $post->image->getThumbnailHref(array('w=73','h=73', 'zc=1','fltr[]=usm|30|0.5|3')) ?>" class="full" alt="<?php the_title(); ?>" />
  37. </a>
  38. <?php endif; ?>
  39. </div>
  40. <?php $i++; ?>
  41. <?php endif; ?>
  42. <?php endwhile; ?>
  43. <?php else : ?>
  44. <h2>Welp, we couldn't find that...try again?</h2>
  45. <div class="entry">
  46. <?php include (TEMPLATEPATH . '/searchform.php'); ?>
  47. </div>
  48. <?php endif; ?>
  49. </div>
  50. </div>
  51. <?php endif; ?>
  52. <?php if ( !is_category('8') ) : ?>
  53. <div class="column <?php if ( !is_category('6') ) : ?>span-11<?php else : ?>span-19<?php endif; ?> last arch">
  54. <h2 class="category_page">Entries</h2>
  55. <?php while (have_posts()) : the_post(); ?>
  56. <?php if ( in_category('6') ): ?>
  57. <div class="post" id="post-<?php the_ID(); ?>">
  58. <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
  59. <p class="small"><?php the_time('F jS, Y') ?>
  60. &nbsp;|&nbsp;
  61. Published in <?php the_category(', '); ?></p>
  62.  
  63. <p><?php the_excerpt(); ?></p>
  64. </div>
  65. <?php endif; ?>
  66. <?php endwhile; ?>
  67. </div>
  68. <?php endif; ?>
  69. </div>
  70. <hr class="space" />
  71. <?php get_sidebar(); get_footer(); ?>

URL: http://kpishdadi.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.