如何在当前帖子中显示wordpress附件?

Ter*_*son 0 wordpress attachment thumbnails

因此,在我的博客中,我有一个照片附件页面,但它一次只能显示照片,而这两张照片用作导航,我讨厌它.

我希望附件页面显示与该组其余部分一起出现的所有照片.

这是当前的代码

        <div id="nav-images" class="navigation clearfix">
            <div class="nav-next"><?php next_image_link() ?></div>
            <div class="nav-previous"><?php previous_image_link() ?></div>
Run Code Online (Sandbox Code Playgroud)

如何更改以显示所有帖子附件?

dan*_*aur 5

为了澄清,这不再起作用 - 至少对于版本3.5.2.我改用它了;

$attachments = get_children(
  array(
    'post_type' => 'attachment',
    'post_parent' => get_the_ID()
  )
);
foreach ($attachments as $attachment) {
  // ...
}
Run Code Online (Sandbox Code Playgroud)

只复活旧线程,因为这个搜索词的排名非常高.