WordPress gallery text link

时间:2015-06-30 13:54:14

标签: wordpress gallery

I am looking for a way to open a gallery slideshow images not by clicking on a thumbnail image but a text link like Go to Gallery.
I don't care wheter using WordPress default gallery, NextGen, Jetpack or any other gallery plugin.

1 个答案:

答案 0 :(得分:0)

如果有人有兴趣,我找到了NextGen Gallery的解决方案。 在nextgen-gallery / products / photocrati_nextgen / modules / ngglegacy / view / gallery.php 更改以下部分:

<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
    <div class="ngg-gallery-thumbnail" >
        <a href="<?php echo nextgen_esc_url($image->imageURL) ?>"
           title="<?php echo esc_attr($image->description) ?>"
           <?php echo $image->thumbcode ?> >
            <?php if ( !$image->hidden ) { ?>
            <img title="<?php echo esc_attr($image->alttext) ?>" alt="<?php echo esc_attr($image->alttext) ?>" src="<?php echo nextgen_esc_url($image->thumbnailURL) ?>" <?php echo $image->size ?> />
            <?php } ?>
        </a>
    </div>
</div>

进入:

<div class="ngg-gallery-thumbnail" >
        <a href="<?php echo nextgen_esc_url($image->imageURL) ?>"
           title="<?php echo esc_attr($image->description) ?>"
           <?php echo $image->thumbcode ?> >
            Link
        </a>
    </div>

之后,我隐藏了CSS-Class'ngg-gallery-thumbnail-box',除了第一个孩子。这很有效。