The functions.php
file for a theme contains functions, called by hooks, that could be called from multiple WordPress pages. The wp
hook, for example, seems to be on every page. You can decide in each function with is_page()
which page is calling and whether or not you want to execute the function for that page.
What is the scope of variables you declare at the top of functions.php
, outside of any of the individual functions? Can that variable be read by any page with a hook to the function? Can one page set the variable and another page read it?