Merge pull request #947 from leoj3n/gallery-fix
Fix gallery link option
This commit is contained in:
@@ -44,7 +44,7 @@ function roots_gallery($attr) {
|
|||||||
'size' => 'thumbnail',
|
'size' => 'thumbnail',
|
||||||
'include' => '',
|
'include' => '',
|
||||||
'exclude' => '',
|
'exclude' => '',
|
||||||
'link' => 'file'
|
'link' => ''
|
||||||
), $attr));
|
), $attr));
|
||||||
|
|
||||||
$id = intval($id);
|
$id = intval($id);
|
||||||
@@ -85,7 +85,17 @@ function roots_gallery($attr) {
|
|||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($attachments as $id => $attachment) {
|
foreach ($attachments as $id => $attachment) {
|
||||||
$image = ('file' == $link) ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
|
switch($link) {
|
||||||
|
case 'file':
|
||||||
|
$image = wp_get_attachment_link($id, $size, false, false);
|
||||||
|
break;
|
||||||
|
case 'none':
|
||||||
|
$image = wp_get_attachment_image($id, $size, false, array('class' => 'thumbnail img-thumbnail'));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$image = wp_get_attachment_link($id, $size, true, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
$output .= ($i % $columns == 0) ? '<div class="row gallery-row">': '';
|
$output .= ($i % $columns == 0) ? '<div class="row gallery-row">': '';
|
||||||
$output .= '<div class="' . $grid .'">' . $image;
|
$output .= '<div class="' . $grid .'">' . $image;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user