?> </a> </div> <?php echo header_image_html(); ?> </div> </div> </header> <main> <article class="front-page"> <div class="container"> <div class="jumbotron"> <h2 id="more-site-anchor"><?php echo get_theme_mod_or_default('homepage_title', null); ?> </h2> <p><?php echo get_theme_mod_or_default('homepage_content', null); ?> </p> </div> <?php echo do_shortcode("[icon-button icon='fa-gittip' text='Planning Your Visit']"); ?> </div> </article> </main> <?php get_footer();
* Set config values including meta tags, registered custom post types, styles, * scripts, and any other statically defined assets that belong in the Config * object. **/ Config::$custom_post_types = array('Page', 'Post', 'IconLink', 'Post', 'Spotlight', 'Section'); Config::$custom_taxonomies = array(); Config::$shortcodes = array('CallToActionSC', 'SectionSC', 'MapSearchSC', 'CalloutSC', 'IconLinkSC', 'RowSC', 'ColumnSC', 'AcademicCalendarSC'); Config::$links = array(array('rel' => 'shortcut icon', 'href' => THEME_IMG_URL . '/favicon.ico'), array('rel' => 'alternate', 'type' => 'application/rss+xml', 'href' => get_bloginfo('rss_url'))); Config::$styles = array(array('name' => 'webcom-admin', 'admin' => True, 'src' => THEME_CSS_URL . '/admin.min.css'), THEME_CSS_URL . '/style.min.css'); if (get_theme_mod_or_default('cloud_typography_key')) { Config::$styles[] = array('name' => 'font-cloudtypography', 'src' => get_theme_mod_or_default('cloud_typography_key')); } Config::$scripts = array(array('name' => 'admin-script', 'admin' => True, 'src' => THEME_JS_URL . '/admin.min.js'), array('name' => 'ucfhb-script', 'src' => '//universityheader.ucf.edu/bar/js/university-header.js?use-1200-breakpoint=1'), array('name' => 'theme-script', 'src' => THEME_JS_URL . '/script.min.js')); Config::$metas = array(array('charset' => 'utf-8'), array('http-equiv' => 'X-UA-Compatible', 'content' => 'IE=Edge'), array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0')); if (get_theme_mod_or_default('gw_verify')) { Config::$metas[] = array('name' => 'google-site-verification', 'content' => htmlentities(get_theme_mod_or_default('gw_verify'))); } /** * Define customizer setting defaults here to make them accessible when calling * get_theme_mod()/get_theme_mod_or_default(). **/ Config::$setting_defaults = array('events_max_items' => 4, 'events_url' => 'http://events.ucf.edu/feed.rss', 'news_max_items' => 2, 'news_url' => 'http://today.ucf.edu/feed/', 'enable_google' => 1, 'search_per_page' => 10, 'cloud_typography_key' => '//cloud.typography.com/730568/675644/css/fonts.css', 'weather_feed_url' => 'http://weather.smca.ucf.edu/', 'map_search_url' => 'http://map.ucf.edu/'); /** * Configure the WP Customizer with panels, sections, settings and * controls. * * Serves as a replacement for Config::$theme_options in this theme. * * NOTE: Panel and Section IDs should be prefixed with THEME_CUSTOMIZER_PREFIX * to avoid conflicts with plugins that may add their own panels/sections to * the Customizer.
public static function callback($attr, $content = '') { $max_events = 6; $items = get_academic_calendar_items(); $first_item = array_shift($items); $full_cal_url = get_theme_mod_or_default('academic_calendar_full_url'); $date = strtotime($first_item->dtstart); $end_dt = empty($first_item->dtend) ? '' : strtotime($first_item->dtend); $month = date('F', $date); $day = date('j', $date); $start_date = date('F j', $date); $end_date = empty($end_dt) ? $end_dt : date('F j', $end_dt); $display_range = False; if ($start_date == $end_date || empty($end_dt)) { $time_string = $start_date; } else { if ($month === date('F', $end_dt)) { $time_string = $start_date . ' - ' . date('j', $end_dt); } else { $time_string = $start_date . ' - ' . $end_date; } $display_range = True; } ob_start(); ?> <div class="calendar-events"> <div class="row"> <div class="col-md-12"> <h2><span class="fa fa-calendar-o icon"></span> Academic Calendar</h2> </div> </div> <div class="row"> <div class="col-md-4 first-item"> <h3>Up Next</h3> <?php if (!$display_range) { ?> <a href="<?php echo $first_item->directUrl; ?> " target="_blank"> <div class="giant-event-date"> <?php $date = strtotime($first_item->dtstart); ?> <span class="month"><?php echo $month; ?> </span> <span class="day"><?php echo $day; ?> </span> </div> <div class="event-details"> <h4 class="time"><?php echo $first_item->summary; ?> </h4> <p><?php echo $first_item->description; ?> </p> </div> </a> <?php } else { ?> <a href="<?php echo $first_item->directUrl; ?> " target="_blank"> <div class="event-details event-date-range"> <h4 class="time"><?php echo $time_string; ?> </h4> <span class="title"><?php echo $first_item->summary; ?> </span> <p><?php echo $first_item->description; ?> </p> </div> </a> <?php } ?> </div> <div class="col-md-8 vertical-border"> <div class="row"> <div class="col-md-12"> <h3>Looking Ahead</h3> </div> </div> <div class="row"> <div class="col-md-6"> <?php foreach ($items as $key => $item) { ?> <?php $date = strtotime($item->dtstart); $end_dt = empty($item->dtend) ? '' : strtotime($item->dtend); $month = date('F', $date); $day = date('j', $date); $start_date = date('F j', $date); $end_date = empty($end_dt) ? $end_dt : date('F j', $end_dt); if ($start_date == $endDate || empty($end_dt)) { $time_string = $start_date; } else { if ($month === date('F', $end_dt)) { $time_string = $start_date . ' - ' . date('j', $end_dt); } else { $time_string = $start_date . ' - ' . $end_date; } } ?> <a href="<?php echo $item->directUrl; ?> " target="_blank"> <div class="row event"> <div class="col-md-12 event-details"> <h4 class="time"><?php echo $time_string; ?> </h4> <p><?php echo $item->summary; ?> </p> </div> </div> </a> <?php if (($key + 1) % 3 == 0) { ?> </div> <div class="col-md-6"> <?php } ?> <?php } ?> </div> </div> </div> <a class="all-link" href="<?php echo $full_cal_url; ?> ">More Academic Calendar Dates ›</a> </div> <?php return ob_get_clean(); }
function get_social_icons($classes = null) { $googleplus_url = get_theme_mod_or_default('googleplus_url'); $twitter_url = get_theme_mod_or_default('twitter_url'); $facebook_url = get_theme_mod_or_default('facebook_url'); $instagram_url = get_theme_mod_or_default('instagram_url'); $youtube_url = get_theme_mod_or_default('youtube_url'); $googleplus_class = 'btn-googleplus'; $twitter_class = 'btn-twitter'; $facebook_class = 'btn-facebook'; $instagram_class = 'btn-instagram'; $youtube_class = 'btn-youtube'; ob_start(); if ($googleplus_url || $twitter_url || $facebook_url || $instagram_url || $youtube_url) { ?> <div class="col-md-3"> <h3>Connect with Us</h3> <div class="social <?php if ($classes) { echo $classes; } ?> "> <?php if ($googleplus_url) { ?> <a class="<?php echo $googleplus_class; ?> ga-event-link" target="_blank" href="<?php echo $googleplus_url; ?> ">Follow us on Google+</a> <?php } ?> <?php if ($twitter_url) { ?> <a class="<?php echo $twitter_class; ?> ga-event-link" target="_blank" href="<?php echo $twitter_url; ?> ">Follow us on Twitter</a> <?php } ?> <?php if ($facebook_url) { ?> <a class="<?php echo $facebook_class; ?> ga-event-link" target="_blank" href="<?php echo $facebook_url; ?> ">Follow us on Facebook</a> <?php } ?> <?php if ($instagram_url) { ?> <a class="<?php echo $instagram_class; ?> ga-event-link" target="_blank" href="<?php echo $instagram_url; ?> ">Follow us on Instagram</a> <?php } ?> <?php if ($youtube_url) { ?> <a class="<?php echo $youtube_class; ?> ga-event-link" target="_blank" href="<?php echo $youtube_url; ?> ">Follow us on YouTube</a> <?php } ?> </div> </div> <?php } return ob_get_clean(); }
function google_tag_manager() { ob_start(); $gtm_id = get_theme_mod_or_default('gtm_id'); if ($gtm_id) { ?> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=<?php echo $gtm_id; ?> " height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','<?php echo $gtm_id; ?> ');</script> <!-- End Google Tag Manager --> <?php } return ob_get_clean(); }
/** * Assembles the appropriate meta elements for facebook's opengraph stuff. * Utilizes the themes Config object to queue up the created elements. * * @return void * @author Jared Lang * */ function opengraph_setup() { if (!(bool) get_theme_mod_or_default('enable_og')) { return; } if (is_search() || is_404()) { return; } global $post; if (!isset($post)) { return; } setup_postdata($post); if (is_front_page()) { $title = htmlentities(get_bloginfo('name')); $url = get_bloginfo('url'); $site_name = $title; } else { $title = htmlentities($post->post_title); $url = get_permalink($post->ID); $site_name = htmlentities(get_bloginfo('name')); } // Set description if (is_front_page()) { $description = htmlentities(get_bloginfo('description')); } else { ob_start(); the_excerpt(); $description = trim(str_replace('[...]', '', ob_get_clean())); // Generate a description if excerpt is unavailable if (strlen($description) < 1) { ob_start(); the_content(); $description = apply_filters('the_excerpt', preg_replace('/\\s+/', ' ', strip_tags(ob_get_clean()))); $words = explode(' ', $description); $description = implode(' ', array_slice($words, 0, 60)); } } $metas = array(array('property' => 'og:title', 'content' => $title), array('property' => 'og:url', 'content' => $url), array('property' => 'og:site_name', 'content' => $site_name), array('property' => 'og:description', 'content' => $description)); // Include image if available if (!is_front_page() and has_post_thumbnail($post->ID)) { $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail'); $metas[] = array('property' => 'og:image', 'content' => $image[0]); } // Include admins if available $admins = trim(get_theme_mod_or_default('fb_admins')); if (strlen($admins) > 0) { $metas[] = array('property' => 'fb:admins', 'content' => $admins); } Config::$metas = array_merge(Config::$metas, $metas); }
function get_news($start = null, $limit = null) { $url = get_theme_mod_or_default('news_url'); $news = FeedManager::get_items($url, $start, $limit); return $news; }
<?php disallow_direct_load('search.php'); get_header(); ?> <h1>Search Results</h1> <?php if (get_theme_mod_or_default('enable_google')) { ?> <?php $domain = get_theme_mod_or_default('search_domain'); $limit = intval(get_theme_mod_or_default('search_per_page')); $start = isset($_GET['start']) && is_numeric($_GET['start']) ? (int) $_GET['start'] : 0; $results = get_search_results($_GET['s'], $start, $limit, $domain); ?> <?php if (count($results['items'])) { ?> <ul class="result-list"> <?php foreach ($results['items'] as $result) { ?> <li class="item"> <article> <h2> <a class="<?php echo mimetype_to_application($result['mime'] ? $result['mime'] : 'text/html');