Title: Enable menu in custom template &#8211; PHP error
Last modified: August 20, 2016

---

# Enable menu in custom template – PHP error

 *  [cmuld3r](https://wordpress.org/support/users/cmuld3r/)
 * (@cmuld3r)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/enable-menu-in-custom-template-php-error/)
 * I’ve recently come back to WordPress theme development but am a bit of a PHP 
   noob. Thanks in advance for the community support 🙂
 * I’m building a custom theme, trying to follow the Codex instructions to enable
   menu functionality (I have no menu link under ‘Appearance’ in the admin area):
   [Codex](http://codex.wordpress.org/Navigation_Menus)
 * With the following code added in functions.php, a menu correctly shows up where
   the location is added in the template (but no ‘Menu’ link in the admin area under‘
   Appearance’):
 *     ```
       function register_my_menus() {
         register_nav_menus(
           array('header-menu' => __( 'Header Menu' ) )
         );
       }
       ```
   
 * The following code in functions.php (line 8):
    `add_action( 'init', 'register_my_menus');`
 * Displays an error:
    [Screenshot](http://slonikstudios.com/wp2012_2-17.png)
 * Any ideas?
 * Again, sorry for my PHP ignorance. Are there any recommended programming/PHP 
   learning resources for relative beginners, preferably specific to WordPress? (
   e.g. how to set up a development environment and check error logs, tutorial examples,
   etc.)

Viewing 1 replies (of 1 total)

 *  Thread Starter [cmuld3r](https://wordpress.org/support/users/cmuld3r/)
 * (@cmuld3r)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/enable-menu-in-custom-template-php-error/#post-2578746)
 * Found the issue.
 * Just read [Theme Development](http://codex.wordpress.org/Theme_Development):
 * > A theme can optionally use a functions file, which resides in the theme subdirectory
   > and is named functions.php. This file basically acts like a plugin, and if 
   > it is present in the theme you are using, it is automatically loaded during
   > WordPress initialization (both for admin pages and external pages).
 * I won’t be editing any more core files. I added a functions.php with the code
   in my theme directory and I’m good to go 🙂

Viewing 1 replies (of 1 total)

The topic ‘Enable menu in custom template – PHP error’ is closed to new replies.

## Tags

 * [menu error](https://wordpress.org/support/topic-tag/menu-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [cmuld3r](https://wordpress.org/support/users/cmuld3r/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/enable-menu-in-custom-template-php-error/#post-2578746)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
