I have a gallery that is a scrolling collection of the images using this short code
[gallery itemtag="div" icontag="span" captiontag="p" link="none" size="full" columns="0"]
EXAMPLE OF GALLERY PAGER:
http://rc2.jaywolfe.com/cars-for-sale/2013-toyota-land-cruiser-base-t30061/
Need to add content JUST after/between the first and second image. I've been able to use this or variant of in other applications but since its within a shortcode I'm struggling to get it.
<?php $counter = 0; ?>
[gallery itemtag="div" icontag="span" captiontag="p" link="none" size="full" columns="0"]
<?php if ($counter % 4 == 3): /* ADD THIS */ ?>
<div>test</div>
<?php endif; ?>
<?php $counter++ ?>
Any guidance would be greatly appreciated.
Ended up finding this worked for me. Just added it to my functions.php file and called the new short code as needed.
function jw_vdp_gallery() {
ob_start();
$id = get_post_thumbnail_id(get_the_ID()); // gets the post thumbnail ID
echo do_shortcode('[gallery exclude='.$id.' itemtag="div" icontag="span" captiontag="p" link="none" size="full" columns="0"]');
$output_string = ob_get_contents();
ob_end_clean();
return $output_string;
}
add_shortcode( 'vdp-gallery', 'jw_vdp_gallery' );