>
$post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); if ( $images ) { // found some images $total_images = count( $images ); $image = array_shift( $images ); $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); ?>

' . __( 'Gallery','weaver-xtreme') . '

'; } else { // did not find any images from the content. // using get_children failed to find any gallery image, so let's do it ourselves. $content = do_shortcode(apply_filters( 'the_content', get_the_content(''))); // pick up wp 3.6 post format if (preg_match('/]+>/i',$content, $images)) { // grab s $src = ''; if (preg_match('/src="([^"]*)"/', $images[0], $srcs)) { $src = $srcs[0]; } else if (preg_match("/src='([^']*)'/", $images[0], $srcs)) { $src = $srcs[0]; } $the_image = ''; $linked = true; ?>

?>