如何在不更改核心文件的情况下替换wp_get_attachment_image()函数。该函数没有动作钩子或过滤器钩子。
对于lazyload插件输出,图像html如下所示:
<img width="150" height="150" data-src="http://localhost/yxz/wp-content/uploads/2010/06/calliope.slide_-150x150.jpg" class="attachment-thumbnail" alt="calliope.slide" src="http://localhost/yxz/wp-content/uploads/blank.png">而不是这样:
<img width="150" height="150" src="http://localhost/yxz/wp-content/uploads/2010/06/calliope.slide_-150x150.jpg" class="attachment-thumbnail" alt="calliope.slide">发布于 2013-06-06 13:04:19
您可以在functions.php文件中创建另一个函数,然后使用它而不是wp_get_attachment_image()。
https://wordpress.stackexchange.com/questions/102079
复制相似问题