Thord Daniel Hedengren - Smashing WordPress_ Beyond the Blog-Wiley (2014)

(avery) #1

CHAPTER 3 • The Loop 61


// Our query and loop
$apple_query = new WP_Query( $args );
while ( $apple_query->have_posts() ) : $apple_query->the_post();
// Let's not output any featured posts
if ( in_array( $post->ID, $do_not_duplicate ) ) continue;
update_post_caches( $posts );
?>




  • title="">





  • // Loop ends
    endwhile;
    // Resetting
    wp_reset_postdata();
    ?>



    Latest from Oranges



      // Loop arguments
      $args = array(
      'category_name' => 'oranges',
      'showposts' => 10
      );
      // Our query and loop
      $orange_query = new WP_Query( $args );
      while ( $orange_query->have_posts() ) : $orange_query->the_post();
      // Let's not output any featured posts
      if ( in_array( $post->ID, $do_not_duplicate ) ) continue;
      update_post_caches( $posts );
      ?>


    • title="">





    • // Loop ends
      endwhile;
    Free download pdf