惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
美团技术团队
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
V
V2EX
J
Java Code Geeks
有赞技术团队
有赞技术团队
博客园 - 聂微东
B
Blog RSS Feed
博客园 - 司徒正美

WordPress Plugin

How to Create an Audio Player Playlist from an XML File Copy Audio URL in Wonder Audio Player YouTube Error 153 | WordPress Plugin Wonder Lightbox JavaScript Events | WordPress Plugin How to Remove URL Query Parameters in Wonder Lightbox How to Dynamically Create a WordPress Image and Video Gallery Using WordPress Media Library IDs How to Add an Image to the Lightbox Gallery Without Showing It in the Grid Gallery How to Make the PDF Page Fit the Entire Lightbox Width When Opening a PDF File Double Tap to Play or Pause the WordPress Audio Player on Touch Devices
How to Create a WordPress Gallery from an XML File
2025-04-22 · via WordPress Plugin

Plugin:

Wonder Gallery

Tutorial:

This tutorial will guide you on how to create a WordPress gallery from an XML file using the Wonder Gallery plugin.

Step 1 - Create an XML file

Using XML allows you to define a playlist of images and videos directly from URLs. For example, if your image and video files are hosted on Amazon S3, you can use an XML file to define the image and video URLs and display them in the gallery.

An XML file is simply a text file that can be edited using a text editor or an XML editor, such as Microsoft's free and open-source XML Notepad.

The format of the XML file for the Wonder Gallery plugin is as follows:

<playlist>
  <slide>
    <file>https://www.wonderplugin.com/xmlgallery/Zebra.jpg</file>
    <thumbnail>https://www.wonderplugin.com/xmlgallery/Zebra.jpg</thumbnail>
    <title>Zebra</title>
    <alt>Zebra</alt>
    <description>Zebra</description>
    <link><![CDATA[https://www.wonderplugin.com]]></link>
    <linktarget>_blank</linktarget>
  </slide>
  <slide>
    <file>https://www.wonderplugin.com/xmlgallery/Carousel.mp4</file>
    <thumbnail>https://www.wonderplugin.com/xmlgallery/Carousel-poster.jpg</thumbnail>
    <title>Wonder Carousel</title>
    <alt>Wonder Carousel</alt>
    <description>Wonder Carousel Video</description>
  </slide>
  <slide>
    <file>https://www.youtube.com/embed/c9-gOVGjHvQ</file>
    <thumbnail>https://img.youtube.com/vi/c9-gOVGjHvQ/0.jpg</thumbnail>
    <title>YouTube</title>
    <alt>YouTube Video</alt>
    <description>YouTube Video</description>
  </slide>
</playlist>

The above XML adds three items to the gallery: one image, one MP4 video, and one YouTube video. The available XML keys are as follows:

Key Description
file The image or video URL
thumbnail The thumbnail image URL
title The title text
description The description text
alt The alt text
link The URL address of the link. Since there are special characters in a URL address, you need to use <![CDATA[ and ]]> to wrap it.
linktarget The target of the web link. The value _blank will open the weblink in a new tab or page.

Step 2 - Upload the XML file to your web server and add the XML file to the plugin

After you have created the XML file, upload it to your web server using FTP or another method, and get the URL address.

Please note that while the images and videos can be hosted on a third-party website, the XML file must be uploaded to your own WordPress website.

You can open the XML file URL in your web browser to ensure the URL is working and the XML output is correct.

Once you have confirmed that the URL is correct, in the Wonder Gallery plugin, edit an existing gallery or create a new one. Navigate to Step 3 Options tab, then to the Advanced Options tab, and add the following code into the Data Options input box:

data-xml="https://www.wonderplugin.com/xmlgallery/wondergallery.xml"

Please make sure to replace the XML URL with your own. And as mentioned above, the XML file must be uploaded to your own WordPress website.

An online demo created with the above XML file is as follows: