1
在一些网站上,如果您单击某篇文章中的图像,则会在底部的帖子中显示图像。我如何复制这种行为?单独页面中的图像与底部的其他图像
我有这段代码但我不知道它是否正确。我甚至不知道在哪里添加这个。任何人都可以帮助解释准确添加的位置吗?
$attachments = get_children(array('post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order ID'));
foreach($attachments as $att_id => $attachment) {
$full_img_url = wp_get_attachment_url($attachment->ID);
// Your Code here
}