I have a section of PHP code that I would like to place in a direc开发者_开发百科tory somewhere and then within my custom WordPress page templates, make reference to this code library at a specific point in my page template.
Can I create my own WordPress hook to grab this code and place it where I want it used?
in your wordpress templates you can use php code. therefore just do an
<?php include("somefile.php"); ?>
You could include all those functions into the functions.php of your theme or you can move them into some external PHP file and include it with include() or require() within your functions.php file.
精彩评论