>

post_content; $pattern = get_shortcode_regex(); preg_match( "/$pattern/s", $content, $match ); if( isset( $match[2] ) && ( "gallery" == $match[2] ) ) { $atts = shortcode_parse_atts( $match[3] ); $attachments = isset( $atts['ids'] ) ? explode( ',', $atts['ids'] ) : get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_id() .'&order=ASC&orderby=menu_order ID' ); } if ($attachments) {?>
  • <?php echo get_post_meta($attachment, '_wp_attachment_image_alt', true) ?>