Related posts

<?php //Gets category info global $wp_query; $cats = get_the_category(); $tempQuery = $wp_query; $currentId = $post->ID;   //related category posts $catlist = ""; forEach( $cats as $c ) { if( $catlist != "" ) { $catlist .= ","; } $catlist .= $c->cat_ID; } $newQuery = "posts_per_page=6&orderby=rand&cat=" . $catlist; query_posts( $newQuery ); $categoryPosts = ""; $count =… Continue reading Related posts