Thesis custom page template with category posts


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

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.


Copy this code and paste it in your HTML
  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

You need to login to post a comment.