I'm creating a custom media center wordpress website.
I have created my own gallery, which I insert into my template via this...
<?php echo do_shortcode('[gallery customgal="true"]'); ?>
But however, on occasions, sometimes my post will have other attachments besides just images.
So I have added this shortcode, using the EG Attachments plugin, which adds other attachments into my post...
<?php echo do_shortcode('[attachments]'); ?>
This works fine. But above my attachment shortcode, I need a H tag title...
<h2>Videos</h2>
<?php echo do_shortcode('[attachments]'); ?>
But my problem is, if no attachments have been added to my post, then I'm stuck with a title and nothing below it!
Is it possible to only display my shortcode if attachments, other than images, exist?
Something like this...
<?php if (attachmentexists()) { ?>
<h2>Other Attachments</h2>
<?php echo do_shortcode('[attachments]'); ?>
<?php } ?>
Any help would be hugely appreciated thanks.