I was wondering whether anyone would know why the following code is returning a number 1 at the end? Does anyone know how to stop this from happening?
function get_product_images_slider() {
$product_image_output = include( get_stylesheet_directory() . '/product-images-shortcode.php');
return $product_image_output;
}
add_shortcode( 'product-images', 'get_product_images_slider' );
my code inside the include is:
<ul class="slick js-fader">
<li>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );?>
<img src="<?php echo $image[0]; ?>" class="figure" width="425" height="328" itemprop="image" />
</li>
<?php
global $product;
$attachment_ids = $product->get_gallery_attachment_ids();
foreach( $attachment_ids as $attachment_id )
{ ?>
<li>
<?php
echo wp_get_attachment_image($attachment_id, 'product-image', '', array( "class" => "figure", 'width' => '425', 'height' => '328', 'itemprop' => 'image' ) );
?>
</li>
<?php }
?>
</ul>