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