Custom Blog Loop on Home Page
don’t use query_posts() for secondary loops – When should you use WP_Query vs query_posts() vs get_posts()? get only top level categories using ‘category__in’ should not get posts from child categories for example: <?php $cats = get_categories(‘parent=0’); foreach ($cats as $cat) : $args = array( ‘posts_per_page’ => 1, ‘category__in’ => array( $cat->term_id ) ); $top_cat_query = … Read more