In light of suspected terrorist threat airport security has been tightened to include new restrictions on "electronic devices". For example, on Heathrow Airport's site they say:


  Make sure your electronic devices are charged before you travel. If your device doesn’t switch on when requested, you won’t be allowed to bring it onto the aircraft.


I travel with an electric violin, not so that I can rock-out during business trips but so that my practise does not disturb people in neighbouring hotel rooms since the electric violin is near-silent without an amplifier.

Will my electric violin fall foul of new airport security restrictions? If so how does one prove that an electric violin (or any other active electronic instrument) is "turned on" without an amplifier to hand?


Question: One random post from multiple custom post types
Answer: This method might work for you.  You will have to grab more posts than you need but it is better than doing 9 queries.

$args = array(
    'post_type' =&gt; array( 'type1', 'type2', 'type3', 'etc...' ),
    'posts_per_page' =&gt; -1
    );

$myquery = new WP_Query( $args );
    $type1 = 0; $type2 = 0; $type3 = 0;  $count = 0;
    while ( $myquery-&gt;have_posts() ) : $myquery-&gt;the_post();

    if ( $post-&gt;post_type == 'type1' ) $type1++; 
    if ( $post-&gt;post_type == 'type1' &amp;&amp; $type1 &gt; 1 ) continue;

    if ( $post-&gt;post_type == 'type2' ) $type2++; 
    if ( $post-&gt;post_type == 'type2' &amp;&amp; $type2 &gt; 1 ) continue;

    if ( $post-&gt;post_type == 'type3' ) $type3++; 
    if ( $post-&gt;post_type == 'type3' &amp;&amp; $type3 &gt; 1 ) continue;

    // I stopped at 3 but keep going as far as you need.

    $count++; if ( $count &gt; 9 ) continue;

    // Do Stuff

    endwhile;