Advertisement
Guest User

alamitos-functions

a guest
Jan 9th, 2013
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.74 KB | None | 0 0
  1. <?php
  2. /*******************************************
  3. functions.php
  4.  
  5. Should be used to include other modules
  6. *******************************************/
  7.  
  8. /*******************************************
  9. Setup Functions:
  10. Used to initiate things in once place
  11. *******************************************/
  12.  
  13. // Used to tell WP to load our custom AJAX
  14. function add_AlamitosJS() {
  15.     wp_enqueue_script( 'al_js',
  16.         get_template_directory_uri() . '/scripts/js.js',
  17.         array('jquery')
  18.     );
  19. }
  20.  
  21. function register_al_menus() {
  22.   register_nav_menu( 'header_menu',__( 'Header Menu'));
  23. }
  24.  
  25.  
  26.  
  27. /*******************************************
  28. Init:
  29. Functions to execute on init
  30. *******************************************/
  31. // add_action('init', 'add_AlamitosJS');
  32. add_action( 'init', 'register_al_menus' );
  33.  
  34.  
  35. // register a sidebar
  36. register_sidebar(array(
  37.   'name' => __( 'Main Sidebar' ),
  38.   'id' => 'sidebar1',
  39.   'description' => __( 'Widgets will appear in the main sidebar.' )
  40.   )
  41. );
  42.  
  43. add_theme_support( 'post-formats', array(
  44.                                     'aside',
  45.                                     'gallery',
  46.                                     'image',
  47.                                     'video',
  48.                                     'audio'
  49.                                 )
  50. );
  51.  
  52. add_theme_support( 'post-thumbnails' );
  53. add_theme_support( 'automatic-feed-links' );
  54.  
  55.  
  56. /*************************
  57. Fix Menu not fetching
  58. *************************/
  59. function getMainMenu($menulocation){
  60.   $locations = get_nav_menu_locations();
  61.   $menuItems = wp_get_nav_menu_items( $locations[ $menulocation ] );
  62.     if(empty($menuItems))
  63.       return false;
  64.     else{
  65.       wp_nav_menu(array('container'=> false, 'theme_location' => $menulocation));
  66.       return true;
  67.     }
  68. }
  69.  
  70. /*******************************************
  71. Conditional loading of functions
  72. *******************************************/
  73.  
  74.  
  75.  
  76. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement