CatSynth – The App

[insert_php]
global $post;
global $more; // Declare global $more (before the loop).
$savedmore = $more;
$more = 1;
echo “

“;
$myposts = get_posts(‘numberposts=10’);
foreach($myposts as $post) :
echo “

“;
setup_postdata($post);
echo “

“;
#now let’s get attachments;
$args = array(
‘post_type’ => ‘attachment’,
‘numberposts’ => 1,
‘post_status’ => null,
‘post_mime_type’ => ‘image/jpeg’,
‘post_parent’ => $post->ID
);
echo “

“;
endforeach;
echo “

“;
echo ‘‘;
the_title();
echo ‘
‘;
echo “
“;
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo ‘‘;
echo wp_get_attachment_image($attachment->ID, “thumbnail”);
echo ‘
‘;
}
}
echo “

“;
$more = $savedmore;
[/insert_php]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.