__( 'Header Menu' ), 'footer-menu' => __( 'Footer Menu' ) ) ); } add_action( 'init', 'register_my_menus' ); add_theme_support( 'post-thumbnails' ); add_image_size( 'home-header', 1920, 550 ); //home header image ORIGINAL FLAVOR // add_image_size( 'home-header', 1920, 300 ); //home header image CHRISTIAN & STACY SIZE add_image_size( 'home-short-story', 303, 363 ); // home short story image add_image_size( 'news-article-sidebar-thumbnail', 90, 90, true ); //sidebar news add_image_size( 'sidebar-promo-box-image', 125, 100, true); // blue custom sidebar widget image add_image_size( 'program-image', 221, 197, true); //program listing add_image_size( 'program-type-image', 372, 221, true); // /programs view add_image_size( 'directors-headshot', 194, 230, true); //directors image of directors add_image_size( 'news-article-listing-image', 194, 230, true); add_image_size( 'staff-headshot', 104, 120, true); // images of staff add_image_size( 'footer-logos', 60, 60); // footer logos add_image_size( 'page-header', 1920, 199, true); // header for page add_image_size( 'google-maps', 302, 138); // contact us sidebar google maps image add_action( 'init', 'create_post_type' ); function formatDate($startingDate,$endingDate,$startingTime,$endingTime,$shorter=false){ $return=''; $month=($shorter) ? 'M' : 'F'; $start_d = mysql2date('j', $startingDate); $end_d = mysql2date('j', $endingDate); $start_m = mysql2date('m', $startingDate); $end_m = mysql2date('m', $endingDate); if($start_m == $end_m){ if($start_d == $end_d){ $return.=mysql2date($month.' j, Y', $startingDate); }else{ $return.=mysql2date($month.' j', $startingDate); $return.=mysql2date(' - j, Y', $endingDate); } } else{ $return.=mysql2date($month.' j', $startingDate); $return.=mysql2date(' - '.$month.' j, Y', $endingDate); } if($startingTime){ $return.=' ( '.$startingTime; if($endingTime){ $return.=' - '.$endingTime; } $return.=' )'; } return $return; } function create_post_type() { /*if ( !post_type_exists( 'news-and-research' ) ) { register_post_type( 'news-and-research', array( 'labels' => array( 'name' => __( 'News & Research' ), 'singular_name' => __( 'News & Research' ) ), 'public' => true, 'has_archive' => false, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes', 'comments' ) ) ); }*/ if ( !post_type_exists( 'quotes' ) ) { register_post_type( 'quotes', array( 'labels' => array( 'name' => __( 'Quotes' ), 'singular_name' => __( 'Quotes' ) ), 'public' => true, 'has_archive' => false, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'page-attributes' ) ) ); } if ( !post_type_exists( 'programs' ) ) { register_post_type( 'programs', array( 'labels' => array( 'name' => __( 'Programs' ), 'singular_name' => __( 'Programs' ) ), 'public' => true, 'has_archive' => false, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes' ) ) ); } if ( !post_type_exists( 'lodging-template' ) ) { register_post_type( 'lodging-template', array( 'labels' => array( 'name' => __( 'Lodging Templates' ), 'singular_name' => __( 'Lodging Template' ) ), 'public' => true, 'has_archive' => false, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes' ) ) ); } if ( !post_type_exists( 'activities-template' ) ) { register_post_type( 'activities-template', array( 'labels' => array( 'name' => __( 'Activities Templates' ), 'singular_name' => __( 'Activity Template' ) ), 'public' => true, 'has_archive' => false, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes' ) ) ); } if ( !post_type_exists( 'application-template' ) ) { register_post_type( 'application-template', array( 'labels' => array( 'name' => __( 'Application Templates' ), 'singular_name' => __( 'Application Template' ) ), 'public' => true, 'has_archive' => false, 'hierarchical' => true, 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'page-attributes' ) ) ); } flush_rewrite_rules( false ); } //use parent template (Propose a program, People) function set_page_template_to_parent() { global $post; if (is_page()) { if ($post->post_parent == 0) return true; else if (($post->post_parent != $post->ID) && ($post->post_parent==64 || $post->post_parent==97)) { $parent_page_template = get_post_meta($post->post_parent,'_wp_page_template',true); $template = TEMPLATEPATH . "/{$parent_page_template}"; if (file_exists($template)) { load_template($template); exit; } } } } add_action('template_redirect','set_page_template_to_parent'); function build_menu($menu_name) { if( ! $menu_name ) return false; $menu_locations = get_nav_menu_locations(); if( ! isset( $menu_locations[$menu_name] ) ) return false; $menu_obj = get_term( $menu_locations[$menu_name], 'nav_menu' ); if( ! $menu_obj ) return false; $menu_id = $menu_obj->term_id; // Modified 06/02/2025 to show all top menu items on mobile device $menu_id = 2; $url = get_permalink( $post->ID ); $homeurl = get_home_url().'/'; $args = array( 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order', 'nopaging' => true, 'update_post_term_cache' => false ); $items = wp_get_nav_menu_items( $menu_id, $args ); if( !count($items) > 0 ) return false; $children = array(); $i = 0; foreach( $items as $parent ) { if( $parent->post_status == 'publish' && $parent->menu_item_parent != '0' ) // Is child { $page_id = $parent->menu_item_parent; $children[$page_id][$i]['url'] = $parent->url; $children[$page_id][$i]['title'] = $parent->title; $i++; } } $menu = ''; $menu .= '