我有以下代码:
<?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-->
此代码位于page.php
默认情况下,我会列出一篇文章。我只想得到那个职位的附件query_posts(\'posts_per_page=1&cat=1\');
现在它还可以获得页面的附件。,我该怎么做?