I have the following code:
<?php
while (have_posts()) : the_post();
if(get_the_title() == 'Archive') query_posts('posts_per_page=1&cat=1');
$category = get_the_category();
if ($category[0]->name) echo '<h1>'.$category[0]->name.'</h1>';
$attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );
foreach ( $attachments as $attachment_id => $attachment ):
$image = wp_get_attachment_url( $attachment_id, 'medium' );
echo $image."<br />";
endforeach;
the_content();
endwhile;
?>
<?php edit_post_link('Click here in order to edit this page'); ?>
</div><!--END /.text-->
This code is in page.php
where by default I list a post.I want to get the attachements only for that post query_posts('posts_per_page=1&cat=1');
now it also get the attachements for the page., how can I do this?