Using Post Indexer With Attachments


The Post Indexer dashboard page is showing that 35 attachments have been indexed. I am not sure the correct way to display the attachments.

display_recent_posts_tester('page'); // Works!
display_recent_posts_tester('post'); // Works!
display_recent_posts_tester('attachment'); // Does Not Work!

Here is the function I am using:

function display_recent_posts_tester($myposttype) {
    $myposts = network_query_posts(array('post_type'=>$myposttype,'posts_per_page'=>50, 'orderby'=>'rand'));
    if( network_have_posts() ) {
      echo "<strong>WE HAZ POSTS! </strong>";
      foreach($myposts as $mypost){
        echo "";

Please advise. Thanks!