How do I link an image in my plugin so it displays on WordPress?
I'm creating a plugin for a college project. The plugin is very simple: it searches for name of the site address and upon finding it in a post, it outputs the site address with an image. However, I cannot get the code working. I've tried this:
?php
/*
Plugin Name: Murtaghs Trademark Plugin
Plugin URI: http://www.MurtaghsPubUndertakers.ie
Description: Adds Murtaghs Logo Wherever name Of Business Displayed On Page.
Author: Connell Gray
Version: 1.0
Author URI: http://www.MurtaghsPubUndertakers.ie
*/
function Murtaghs_Trademark_Plugin($text) {
$site_name = get_bloginfo();
//the logo.jpg file is stored in a folder called images which i have created in the plugins folder//
$new_site_name = $site_name . 'supecho 'img src="' . plugins_url( 'images/wordpress.png' ,"logo.jpg" ) . '" '/sup';
$text = str_replace($site_name,$new_site_name,$text);
return $text;
}
add_filter('the_content','Murtaghs_Trademark_Plugin');
?