首先,在主题文件functions.php加入下面的代码:
functionphoto($atts,$content=null){$exif=exif_read_data(''.$content.'',0,true);return"<br />n"."<strong>[器材]</strong> ".$exif[IFD0][Make].$exif[IFD0][Model]."<br />n"."<strong>[参数]</strong> "."光圈:".$exif[COMPUTED][ApertureFNumber]." 快门:".$exif[EXIF][ExposureTime]." 焦距:".$exif[EXIF][FocalLength]."mm"." ISO:".$exif[EXIF][ISOSpeedRatings]." 拍摄日期:".$exif[EXIF][DateTimeOriginal];}
然后编辑主题文件的style.CSS加入下面css样式:
.exif{background:#FFD;height:50px;font-size:12px;line-height:16px;border:1pxsolid#999;border-left:4pxsolid#600;margin:2px0;padding:4px;}
调用格式:
<divclass="exif">[pho]http://图片地址[/pho]</div>
演示效果如图:
ps:本人css实在烂,弄不出来好看的样式。
原文地址:http://www.xj123.info/3043.html