Tag: wordpress shortcode
为WordPress[gallery]短标签里的图片链接添加更多属性
Add rel Attribute to Image Links in WordPress Galleries 如果你想给[ gallery ] 里的图片链接加上而外的属性, rel 或者 class 等等,去配合使用 fancybox、 lightbox 等 jQuery 插件。代码如下: If you want to use either Fancybox or Lightbox scripts for image galleries, you need to add the rel attribute to all full size image links. Here is how to do it: add_filter(‘wp_get_attachment_link’, ‘add_gallery_id_rel’); function add_gallery_id_rel($link) { global $post; return…