WordPress调用Gallery图片

本来想用WPG2的,但看到这个插件使用需求:

1. To use the “WPG2” plugin, you must have WordPress & Gallery2 installed and properly configured
2. Running at least WordPress 2.2 and Gallery2 2.2
3. WordPress & Gallery2 may be on different subdomains but NOT on different servers.
4. WordPress & Gallery2 should be installed on the same database but can be different databases
5. Only one WordPress Blog tied to one Gallery2 Gallery
6. PHP memory limit of 16MB or better.
7. Browser that supports Javascript
8. Gallery2 Imageblock (version 1.0.9 or greater) and ImageFrame Plugins installed & Activated.

顿时完蛋,偶的WordPress BlogGallery相册完全安装在不同的服务器,不同的域名,不同的数据库.
汗.
抱着侥幸心理下载安装了WPG2,尝试设置,果然错误.

找其它方法.
搜索一下,Gallery2有”Image Block” Module可以外部调用图片,于是安装这个Module.后台可以看到默认的调用代码


默认输出格式类似


B06A

B06A

WordPress Text Widget 不支持 PHP代码,找了一个Executable PHP Widget插件,安装后插入一个PHP code widget,把上面代码复制进去,刷新首页看看效果

汗,没显示.看看源文件,没有输出?
测试一下,其它的php代码貌似没问题,为啥 readfile不能输出?

这样的话,貌似只能手工修改模板文件.
加入相关代码

1 Response to “WordPress调用Gallery图片”


Comments are currently closed.