Using a PHP include in wordpress

//Using a PHP include in wordpress

After a little messing around I decided to use this method to show a menu across a website as an include so it can be easily updated in one place. I am not a fan of most of the menu plugins that come with wordpress and would rather use this method. I hard code the following code into the header of my theme. An example is below. This can refer to any directory or file on your server that is the include file.

<?php include($_SERVER[‘DOCUMENT_ROOT’]."/includes/menu.inc.php"); ?>

Enjoy. Some other methods can be found here. http://www.tomcatuk.net/how-to-use-a-php-include-with-wordpress/

2012-03-05T16:01:15+00:00