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

Enjoy - WordPress Magazine and Blog Theme (News / Editorial) - New WordPress themes
h1 a:hover {background-color:#888;color:#fff ! important;} ...
Eduka - Education & University WordPress Theme (Business) - New WordPress themes
h1 a:hover {background-color:#888;color:#fff ! important;} ...
Libero - Blog & Magazine (Blog / Magazine) - New WordPress themes
h1 a:hover {background-color:#888;color:#fff ! important;} ...
Samphatic | Charity/Non-Profit WordPress Theme (Nonprofit) - New WordPress themes
h1 a:hover {background-color:#888;color:#fff ! important;} ...