Posted By

kristarella on 01/25/09


Tagged

wordpress thesis archives thesiswp WPQuery


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

umang_nine
girliegeek
joelhaus
vintagekrug
naeemnur


Add category archives to a page (in Thesis)


 / Published in: PHP
 

The function content should work in any theme, it's just wrapped in a function wrapper for insertion into the Thesis theme.

  1. function add_category_archives() {
  2. if (is_page('page')) {
  3. $archive_query = new WP_Query('showposts=1000&category_name=Category');
  4. if ($archive_query->have_posts()) echo '<h2>Category Posts</h2>';
  5. $post_count = 1;
  6. while ($archive_query->have_posts()) {
  7. $archive_query->the_post();
  8. ?>
  9. <div class="post_box hentry<?php if ($post_count == 1) echo(' top'); ?>">
  10. <?php thesis_headline_area(); ?>
  11. </div>
  12.  
  13. <?php
  14. $post_count++;
  15. }
  16. }
  17. }
  18. add_action('thesis_hook_after_content', 'add_category_archives');

Report this snippet  

You need to login to post a comment.