所以我在单曲中使用了一个图库的快捷码。php文件用于单个贴子页面。
问题是,库只显示在页面顶部或底部。我想在单篇文章页面的文本下方显示图库。
有没有办法指定快捷码输出的显示位置?谢谢
仅有一个的php:
if ( $post->post_status == \'publish\' ) {
$attachments = get_posts( array(
\'post_type\' => \'attachment\',
\'posts_per_page\' => -1,
\'post_parent\' => $post->ID,
\'exclude\' => get_post_thumbnail_id()
) );
if ( $attachments ) {
$atts = array();
foreach ( $attachments as $attachment ) {
$class = "post-attachment mime-" . sanitize_title( $attachment->post_mime_type );
$thumbimg = wp_get_attachment_link( $attachment->ID, \'thumbnail-size\', true );
$atts[] = $attachment->ID;
}
$aantal = count($atts);
echo do_shortcode(\'[av_gallery ids="\' . implode(",", $atts) . \'" type="slideshow" preview_size="large" crop_big_preview_thumbnail="avia-gallery-big-crop-thumb" thumb_size="portfolio" columns="\' . implode(",", $aantal) . \'" imagelink="lightbox" lazyload="avia_lazyload" av_uid="av-jgesnq4m" custom_class="av-gallery-style-"]\');
}
}