Q:

Adding a menu using Hooks in Wordpress

On the site: http://www.cabinetstogo.company/ I'm using the Total Theme (http://themeforest.net/item/total-responsive-multipurpose-wordpress-theme/6339019) and I need to add an additional menu in the top bar by the social links.  The theme author suggested I do this using hooks (http://wpexplorer-themes.com/total/docs/action-hooks/) but it's a little beyond me.  
I have set the site up using a child theme but I have been unsuccessful in putting any functions into a functions.php file in the child theme folder without breaking the site.  For example, I tried this:
<? php register_nav_menu( 'top_menu', 'Top Menu' );

//adds category menu on single post pages
function top_menu()
{
wp_nav_menu(array('menu'=>'Top')); }

add_action('wpex_hook_header_before_default', 'add_top_menu'); 
? >

I am using the action 'wpex_hook_header_before_default' because from what I can tell, that is the location of where i want it to go but honestly I'm quite lost. 
The theme author seems to say it's quite simple but it has not been the case for me.  Any assistance would be much appreciated. 

A:

You are adding an action add_action('wpex_hook_header_before_default', 'add_top_menu'); setting a add_top_menu() function as callback, but this function doesn't actually exists; The function you are creating is top_menu(), this is probably what's happening and crashing the whole site.  
Just add 'add_' to the function name or remove 'add_' from the hook callback, like such:
<? php register_nav_menu( 'top_menu', 'Top Menu' );

//adds category menu on single post pages
function add_top_menu(){
    wp_nav_menu(array('menu'=>'Top')); 
}

add_action('wpex_hook_header_before_default', 'add_top_menu'); 
? >

