1
我是新的wordpress插件&在我的笔记本电脑上我的wamp服务器上运行wordpress,我写了&在我的wordpress网站(站点名称:lifyog)我的桌面。写在插件中的函数应该为每个帖子添加图像,但它不起作用。请帮助纠正代码。插件激活,但不能在桌面上的wordpress工作
我已检查图片来源这很关键。
我的插件是在以下地址:
wamp/www/wordpress/wp-content/plugins/Wpplugin
文件名是addimage.php
插件的代码是为下:
<?php
/*
Plugin Name: Add Image
Plugin URL:http//wordpress
Version: 1.0
Author: wordpress
Author URL: http://localhost/wordpress
Description: This plugin automatically adds an image at the beginning of every post
*/
function addImage($post)
{
$imagewithtext="<img src='http://localhost/wordpress/wp-content/themes/twentyfifteen/Images/veer.jpg' height='70px' width='70px' align='left'>";
$imagewithtext=$post;
return $imagewithtext;
}
add_filter("the_content","addImage");
?>
非常感谢你的工作 – user3811050