post->post_author; $tempQuery = $wp_query; $currentId = $post->ID; // related author posts $newQuery = "posts_per_page=4&author=" . $authorPosts; query_posts( $newQuery ); $authorPosts = ""; $count = 0; if (have_posts()) { while (have_posts()) { $count++; the_post(); if( $count<4 && $currentId!=$post->ID) { $count++; $authorPosts .= '
  • ' . the_title( "", "", false ) . '
  • '; } } } // related category posts $catlist = ""; forEach( $cats as $c ) { if( $catlist != "" ) { $catlist .= ","; } $catlist .= $c->cat_ID; } $newQuery = "posts_per_page=5&cat=" . $catlist; query_posts( $newQuery ); $categoryPosts = ""; $count = 0; if (have_posts()) { while (have_posts()) { the_post(); if( $count<4 && $currentId!=$post->ID) { $count++; $categoryPosts .= '
  • ' . the_title( "", "", false ) . '
  • '; } } } $wp_query = $tempQuery; ?>