为其他想要执行此操作的人排序的代码是:
<?php
$args = array(
\'post_type\' => \'attachment\',
\'numberposts\' => -1,
\'post_status\' => null,
\'post_parent\' => null,
);
$attachments = get_posts( $args );
foreach ( $attachments as $attachment ) {
if ($attachment->post_title == $programme) {
echo wp_get_attachment_link($attachment->ID, \'thumbnail\', false, false);
break;
}
}
?>