我刚开发了一个带有ng-gallery插件的wordpress网站 . 我想获取图像alt标签并为图像标签添加新的 Headers 属性 . 这是我的代码..
<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和description . 但是在主页中没有显示alt属性 .
目前仅显示 src 和 Style 属性 .
如何将 Alt and Title 属性添加到上面的代码中 .
感谢和问候
1 回答
Nextgen gallery允许您创建自定义模板 .
1.在活动主题中,创建名为:nggallery的文件夹
2.将
gallery.php
从:/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/view
复制到您在步骤1中创建的nggallery文件夹3.现在在nggallery文件夹中将
gallery.php
重命名为gallery-mytemplate.php
并根据需要进行修改,以便显示替代文本和属性 .4.使用以下短代码告诉Nextgen Gallery使用您的自定义模板显示图库,而不是默认模板
[nggallery id=1 template=mytemplate]