You can use a WP function to detect if any attachment...
In your template php:
$args = array(
'post_type' => 'attachment',
'numberposts' => null,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
echo do_shortcode( '[gallery royalslider="1"]' ) ;
}
?>
.
help.dimsemenov.com
No comments:
Post a Comment