Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter jondobrien

    (@jondobrien)

    Unfortunately that didn’t work, even after removing the extra =

    $my_attachments = = get_posts( $attach_args );

    The nearest bit of code that I’ve found that does anything like is

    <?php
    
    $mypages = get_pages('child_of=7');
    foreach ( $mypages as $mypage  ) {
    $attachments = get_children(array(
    'post_parent' => $mypage->ID,
    'numberposts' => -1,
    'post_type' => 'attachment',
    'post_mime_type' => 'application/pdf', 
    
    ));?>
    
    <?php
    if ($attachments) {
    
        foreach ( $attachments as $post ) {
            setup_postdata($post);
            the_title();
    	the_attachment_link($post->ID, false);
    
        }
    }
    }
    ?>

    But it isn’t a bulleted list and it seems to only be showing 5 links from 5 random pages. Can’t work out why it’s showing those pages or why it’s only showing one of the two attachments per page.

Viewing 1 replies (of 1 total)