Help creating plugin
-
Hi,
I am a starter and would be happy to get some help in creating a plugin.What I want to achieve is, display a Flash Movie (example: myMovie.swf) from a “plugins/myPlugin” folder by inserting a PHP code in the template PHP code.
Looks simple but cant get to it 🙁
Here is my existing code:
<?php/*
Plugin Name:
Plugin URI:
Description:
Author:
Version:
Author URI:
*/add_action('the_content', 'my_function');
function my_function()
{$output = "<object type=\"application/x-shockwave-flash\" data=\"$filename\" width=\"600\" height=\"212\"><param name=\"movie\" value=\"$filename\" /></object>";
return $output;
}
?>After activating the plugin, I added this code to the index.php (header):
<?php get_header(); ?><?php if (function_exists('my_function')) : ?>
<?php my_function(); ?>
<?php endif; ?>
When I use this code, the flash movie gets embeded in every post.
Any help??
The topic ‘Help creating plugin’ is closed to new replies.