'the-bootstrap-gallery', 'description' => __( 'Displays gallery images of a specified post with the Gallery post format.', 'the-bootstrap' ) ) ); } /** * Displays the widget content * * @author Konstantin Obeland * @since 1.1.0 - 08.03.2012 * @access public * * @param array $args * @param array $instance * * @return void */ public function widget( $args, $instance ) { if ( ! has_post_format( 'gallery', $instance['post_id'] ) ) return; $attachments = get_children( array( 'post_parent' => $instance['post_id'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID', ) ); if ( empty( $attachments ) ) return; extract( $args ); echo str_replace( 'well ', '', $before_widget ); if ( $title = get_the_title( $instance['post_id'] ) ) echo $before_title . '' . $title . '' . $after_title; ?>
0, ) ); $gallery_posts = get_posts( array( 'numberposts' => -1, 'tax_query' => array( array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-gallery' ) ) ) ) ); if ( empty( $gallery_posts ) ) { echo ''. sprintf( __( 'No galleries have been created yet. Create some.', 'the-bootstrap' ), admin_url( 'post-new.php' ) ) . '
'; return; } ?>