如何将媒体库中的图像标题与变量匹配,然后回显该图像?这是我当前的代码。。。
<?php
$args = array(
\'post_type\' => \'attachment\',
\'numberposts\' => -1,
\'post_status\' => null,
\'post_parent\' => null,
);
$attachments = get_posts( $args );
if ($attachment->post_title == $programme) {
echo the_attachment_link($post->ID, false);
}
?>