WordPress native album enhancement plug-in WP Galaxy Lightbox released

Due to the characteristics of this blog, a large number of pictures are often inserted into this blog. If each photo is inserted into the article independently, it may not look beautiful and is not conducive to typesetting. Fortunately, WP comes with an album function, which can insert multiple pictures into an album and display them in the form of thumbnails or other sizes.
The foreground page generated by WP's own album can only be linked to the source file or media file page, which does not look elegant. I wrote a small plug-in to make a light box pop up when I click on an album picture, and display the complete picture in the light box.

Plug in preview (click the picture to try)

Click the above picture to pop up the light box, and the mouse hovering light box picture will have left and right page turning buttons.
Or visit Photo album effect preview page

Plug in download

Github- WP-Gallery-LightBox

Update log

  • V1.0.4 Fix the bug of repeatedly loading JS CSS and disable switching when the animation is not played (2019-1-13)
  • V1.0.3 Reject unqualified JQuery imports
  • V1.0.2 Add background setting page
  • V1.0.1 Replace the plug-in with a new version that depends on JQuery, and modify the plug-in code to make the effect consistent with the old version
  • V1.0.0 Initial upload

principle

Plug in principle: replace the album short code processing function, and add the relevant code of LightBox.js in the output content.
For specific code and principle, please refer to the article on this website: Write a WordPress plug-in from scratch - take the transformation of native album as an example

usage method

  1. Download the plug-in, package the zip, upload and enable it.
  2. Select Add Media ->Create Album in the upper left corner when editing an article or page.
  3. Select your favorite image (multiple choices), and then click the lower left corner to create a new album to enter the album setting page.
  4. Set in the upper right corner Album size , and set link to The option is changed to Media files ( important )。
  5. Click Insert Album to add the album short code to the article.
  6. Return to the foreground preview effect.

help

If you need help, you can join Zimiao haunts blog communication groups , Group No.: three hundred and thirteen million seven hundred and thirty-two thousand
Click the link to join the group chat: https://jq.qq.com/?_wv=1027&k=5GXKmKy

common problem

  1. Click the image to jump to the image url
    Check whether the JQuery library is imported. If not, import it. Then check whether the foreground output content is normal.
  2. The size of the album is a thumbnail, and the size of the album output from the foreground is uneven
    The size of the foreground album is related to the thumbnail cutout size set by WP background.
  3. Whether to support non album ordinary pictures
    I won't support it. The light box function of this blog is only used for photo album display, so I didn't write it.
  4. Applicable WordPress version
    WordPress 4.7. x has been tested, and other versions have not been tested.

Third party content

  1. LightBox2.js @MIT protocol, and this blog has modified its animation effect.
  2. PureLove theme background setting interface style.
  3. wp-includes/media.php @GPL protocol, copy and modify the album processing source function.

References

1. [Photo album] [SEVEN] おくささががががががおくくくささががが! Screenshot of cartoon

Zimiao haunting blog (azimiao. com) All rights reserved. Please note the link when reprinting: https://www.azimiao.com/3942.html
Welcome to the Zimiao haunting blog exchange group: three hundred and thirteen million seven hundred and thirty-two thousand

Comment

*

*

Comment area

  1. c0sMx 07-02 09:20 reply

    support!

  2. Wow, when are you coming to typecho

  3. hk 07-04 14:13 reply

    Sculling

  4. Code 18 07-20 14:51 reply

    Nice, it's perfect. Thanks to the blogger

  5. joe 11-16 16:30 reply

    It's much better
    Whether to add a page turning function is to display pages when there are many pictures

  6. Weevil 04-19 23:38 reply

    Where can I download it?

  7. In WordPress 5.2.2, the prompt: PHP Notice: Undefined index: gallery lightbox save once in \Wp content plugins WP Callery LightBox Plus zm_gallery_light_admin.php on line 26, please tell me the reason, thank you!

    • hare 07-13 01:15 reply

      This problem has been fixed. Please download the latest content from github.

      • After the update, the undefined problem has been solved. In addition, it seems that the gallery_shortcode is no longer used in WP 5.2.2, because even the original short gallerycode has no log output. Thank you!

        • hare 07-13 11:30

          Please check whether JQuery has been introduced and the test is available.