Ho provato con questo
Codice PHP:
<?php while (have_posts()) : the_post(); ?>
<?php
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_mime_type' => 'image',
'orderby' => 'rand',
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo '<a href="'.get_permalink().'">';
echo '<img>ID).'">';
echo '</a>';
}
}
?>
che va benissimo perchè mi mostra tutte le immagini dei post.
quello che vorrei riuscire a fare è di visualizzarli "mescolati", infatti ora l'order by è random.
Il problema è il post_parent: mettendo post_ID mi oganizza gli allegati dividendoli in base al post e poi randomizzando le immagini dello stesso post tra di loro..(p è il post)
p1_img2 p1_img1 p1_img3 | p2_img1 p2_img2 | p3_img3 p3_img4 p3_img1 p3_img2
io vorrei
p3_img2 p2_img1 p1_img3 p1_img1 p2_img2 p3_img4 p3_img3 p3_img1 p1_img2`