I am following the instructions in 6 Practical WordPress Projects as regards putting together a non-blog WordPress website. Consequently, I have copied and pasted the code provided by the book to functions.php, as instructed.
Unfortunately, doing this returns a ‘fatal error’.
My functions.php file contains no other code except the code that I copied and pasted from 6 Practical WordPress Projects. (I have, of course, added the opening php tag as required, though I understand that the closing tag is not required.)
Thank you for your indulgence. I’ll do my best to correct the code and report back. Since everything was working fine until I uploaded functions.php as reported, I am confident that the only error was in functions.php.
Your correction has worked, Gandalf, so all is well in my world now. What I have learned in the process is that it is a good idea to add function code snippets to functions.php one at a time, and to test them one at a time.