Plugins / A Basic Plugin

This example shows you the basics of creating a plugin, including hooking to an anchor and outputting a message. It will add a message to the top of the page, before the theme's HTML begins (not very useful, but you get the idea).

<?php 
	// Define hooks 
	hook( "site_begin", "sayHello" ); 
 
	// Functions 
	function sayHello() 
	{ 
		echo '<h1>Hello world!</h1>'; 
	} 
?>

That's it!

Related