so I have a shortcode for a gallery I'm using in the Single.php file for the single post pages.
The problem is that the gallery only shows either at the top of the page, or at the bottom. I would like to show the gallery right under the text on the Single Post Page.
Is there a way to specify where the shortcode output displays? Thanks
Single.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-"]');
}
}