Posted By

kristarella on 04/28/09


Tagged

template wordpress thesis thesiswp


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

mlangfeld
nickreese
girliegeek
joelhaus
naeemnur


Thesis custom page template with category posts


 / Published in: PHP
 

This turns the about page into a featured category post page. The principles for just a regular custom page template with sidebars is there too.

  1. function add_category_archives() {
  2. if (is_page('about')) {
  3. $limit = get_option('posts_per_page');
  4. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  5. query_posts('category_name=Featured&showposts=' . $limit . '&paged=' . $paged);
  6. echo '<div id="content">';
  7. thesis_home_loop();
  8. echo '</div>' . "\n" . '<div id="sidebars">';
  9. thesis_build_sidebars();
  10. echo '</div>';
  11. }
  12. }
  13. remove_action('thesis_hook_custom_template','thesis_custom_template_sample');
  14. add_action('thesis_hook_custom_template', 'add_category_archives');

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: nickreese on August 26, 2009

Brilliant, love it!

You need to login to post a comment.