Wednesday, May 15, 2013

[Help Wordpress] Hiding the error


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

Search

Other post