如何获取 Wordpress NgGallery 图片的 Alt 标签

How to get Alt tag for Wordpress NgGallery Image

我刚刚用 ng-gallery 插件开发了一个 wordpress 网站。 我想要获取图像 alt 标签并向图像标签添加新的 title 属性。 这是我的代码..

<div id="ngg-slideshow-1-6-1" class="ngg-slideshow" style="height:515px;width:576px;">

<img src="http://www.sweetpassion.com.au/wp-content/gallery/homepage/sydney-royal-easter-show-2014-master-class-competition.jpg" style="height: 515px; width: 386px; position: absolute; top: 0px; left: 0px; display: none; z-index: 10; opacity: 0;">

我在 ng-gallery 中添加了 alt 和描述 end.But alt 属性未显示在主页中。

目前仅显示 src & Style 属性。

如何在上面的代码中添加 Alt 和 Title 属性。

感谢和问候

Nextgen 画廊允许您创建自定义模板。

1.In 您激活主题,创建名为 nggallery 的文件夹

2.Copy gallery.php 从:/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view 到您在步骤 1 中创建的 nggallery 文件夹

3.Now 在 nggallery 文件夹中将 gallery.php 重命名为 gallery-mytemplate.php 并根据需要修改它,以便它显示替代文本和属性。

4.Use 以下短代码告诉 Nextgen Gallery 使用您的自定义模板而不是默认模板显示画廊 [nggallery id=1 template=mytemplate]