max_num_pages < 2 ) { return; } ?> post_parent ) : get_adjacent_post( false, '', true ); $next_post = get_adjacent_post( false, '', false ); if ( ! $next_post && ! $prev_post ) { return; } ?>
ID; else : $attachment_parent = get_the_ID(); endif; $images = get_posts( array( 'post_parent' => $attachment_parent, 'post_type' => 'attachment', 'numberposts' => 999, // show a large but unlikely number 'post_status' => null, 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', ) ); /* * Grab the IDs of all the image attachments for this post */ if ( $images ) { foreach ( $images as $id ) { $ids[] = $id->ID; } } } if ( $ids ) : //We have images? Let's do this! ?> ID; else : $attachment_parent = get_the_ID(); endif; /* * Grab the IDs of all the image attachments for this post */ if ( $images = get_posts( array( 'post_parent' => $attachment_parent, 'post_type' => 'attachment', 'numberposts' => 999, // show a large but unlikely number 'post_status' => null, 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', ) ) ) { ?> comment_type || 'trackback' == $comment->comment_type ) : ?>