");
$i = 0;
foreach ( $attachments as $id => $attachment ) {
//$link = wp_get_attachment_link($id);
$a_img = wp_get_attachment_url($id);
// Attachment page ID
$att_page = get_attachment_link($id);
// Returns array
$img = wp_get_attachment_image_src($id, $size);
$img = $img[0];
$title = trim($attachment->post_excerpt) ? wptexturize($attachment->post_excerpt) : $attachment->post_title;
$output .= "<{$itemtag} class='gallery-item'>";
$output .= "
<{$icontag} class='gallery-icon'>
ID}\">
{$icontag}>";
if ( $captiontag && trim($attachment->post_excerpt) ) {
$output .= "
<{$captiontag} class='gallery-caption'>
" . wptexturize($attachment->post_excerpt) . "
{$captiontag}>";
}
$output .= "{$itemtag}>";
if ( $columns > 0 && ++$i % $columns == 0 )
$output .= '
';
}
$output .= "
\n";
return $output;
}
remove_shortcode(gallery);
add_shortcode('gallery', 'lbe_gallery_shortcode');
function lbe_lightbox_shortcode($atts, $content = null)
{
$options = array();
foreach ((array)$atts as $key=>$option)
{
if ($key != 'href' && $key != 'rel')
{
$options["lightbox[$key]"] = $option;
}
}
$atts['href'] = do_shortcode($atts['href']);
$content = do_shortcode($content);
return '