<?php
/*******************************************
functions.php
Should be used to include other modules
*******************************************/
/*******************************************
Setup Functions:
Used to initiate things in once place
*******************************************/
// Used to tell WP to load our custom AJAX
function add_AlamitosJS() {
wp_enqueue_script( 'al_js',
get_template_directory_uri() . '/scripts/js.js',
array('jquery')
);
}
function register_al_menus() {
register_nav_menu( 'header_menu',__( 'Header Menu'));
}
/*******************************************
Init:
Functions to execute on init
*******************************************/
// add_action('init', 'add_AlamitosJS');
add_action( 'init', 'register_al_menus' );
// register a sidebar
register_sidebar(array(
'name' => __( 'Main Sidebar' ),
'id' => 'sidebar1',
'description' => __( 'Widgets will appear in the main sidebar.' )
)
);
add_theme_support( 'post-formats', array(
'aside',
'gallery',
'image',
'video',
'audio'
)
);
add_theme_support( 'post-thumbnails' );
add_theme_support( 'automatic-feed-links' );
/*************************
Fix Menu not fetching
*************************/
function getMainMenu($menulocation){
$locations = get_nav_menu_locations();
$menuItems = wp_get_nav_menu_items( $locations[ $menulocation ] );
if(empty($menuItems))
return false;
else{
wp_nav_menu(array('container'=> false, 'theme_location' => $menulocation));
return true;
}
}
/*******************************************
Conditional loading of functions
*******************************************/
?>