function related_posts() { if (is_page(101)) { $post_count = 0; $teaser_count = 1; query_posts("cat=3&showposts=10"); if ( have_posts() ) : while ( have_posts() ) : the_post(); if (thesis_is_teaser($post_count)) { if (($teaser_count % 2) == 1) { $top = ($post_count == 1) ? ' top' : ''; $open_box = "\t\t\t
\n\n"; $close_box = ''; $right = false; } else { $open_box = ''; $close_box = "\t\t\t
\n\n"; $right = true; } if ($open_box != '') { echo $open_box; thesis_hook_before_teasers_box($post_count); } thesis_teaser($classes, $post_count, $right); if ($close_box != '') { echo $close_box; thesis_hook_after_teasers_box($post_count); } $teaser_count++; } endwhile; else: endif; //Reset Query wp_reset_query(); } } add_action('thesis_hook_after_post_box', 'related_posts');