使用内置post附件有什么问题
$args = array(
\'post_type\' => \'attachment\',
\'numberposts\' => null,
\'post_status\' => null,
\'post_parent\' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
echo apply_filters(\'the_title\', $attachment->post_title);
the_attachment_link($attachment->ID, false);
}
}
您可以得到相同的结果,并且不会使Posteta表过载。