您好,我正在使用一些代码创建一个具有lytebox功能的幻灯片-以下代码用于循环中,以按顺序将每个附加到帖子的图像拉出来。
它似乎只是拉大图像,甚至认为我已经将值设置为中等-任何我可以得到的想法。wp\\u get\\u attachment\\u url($attachment->ID,\'medium\',false,false)是否要拉取中等大小的图像?
谢谢
<?php
$argsThumb = array(
\'order\' => \'DESC\',
\'post_type\' => \'attachment\',
\'post_parent\' => $post->ID,
\'post_mime_type\' => \'image\',
\'post_status\' => null
);
$attachments = get_posts($argsThumb);
if ($attachments) {
foreach ($attachments as $attachment) {
echo \'<div class="images"><a class="lytebox" href="\' .wp_get_attachment_url($attachment->ID, \'medium\', false, false). \'"><img src="\'.wp_get_attachment_url($attachment->ID, \'medium\', false, false).\'" /><div class="caption">\'.apply_filters(\'the_content\', $attachment->post_content).\'</div></a></div>\';
}
}