Example #1
0
date_default_timezone_set('EST');
/**
 * 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
Example #2
0
/**
 * 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()
{
    $options = get_option(THEME_OPTIONS_NAME);
    if (!(bool) $options['enable_og']) {
        return;
    }
    if (is_search()) {
        return;
    }
    global $post, $page;
    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($options['fb_admins']);
    if (strlen($admins) > 0) {
        $metas[] = array('property' => 'fb:admins', 'content' => $admins);
    }
    Config::$metas = array_merge(Config::$metas, $metas);
}
Example #3
0
 * object.
 **/
Config::$custom_post_types = array('Page', 'AlumniNote', 'Story', 'Issue');
Config::$custom_taxonomies = array('Issues');
Config::$body_classes = array();
/**
 * Configure theme settings, see abstract class Field's descendants for
 * available fields. -- functions/base.php
 **/
Config::$theme_settings = array('Analytics' => array(new TextField(array('name' => 'Google WebMaster Verification', 'id' => THEME_OPTIONS_NAME . '[gw_verify]', 'description' => 'Example: <em>9Wsa3fspoaoRE8zx8COo48-GCMdi5Kd-1qFpQTTXSIw</em>', 'default' => null, 'value' => $theme_options['gw_verify'])), new TextField(array('name' => 'Yahoo! Site Explorer', 'id' => THEME_OPTIONS_NAME . '[yw_verify]', 'description' => 'Example: <em>3236dee82aabe064</em>', 'default' => null, 'value' => $theme_options['yw_verify'])), new TextField(array('name' => 'Bing Webmaster Center', 'id' => THEME_OPTIONS_NAME . '[bw_verify]', 'description' => 'Example: <em>12C1203B5086AECE94EB3A3D9830B2E</em>', 'default' => null, 'value' => $theme_options['bw_verify'])), new TextField(array('name' => 'Google Analytics Account', 'id' => THEME_OPTIONS_NAME . '[ga_account]', 'description' => 'Example: <em>UA-9876543-21</em>. Leave blank for development.', 'default' => null, 'value' => $theme_options['ga_account'])), new TextField(array('name' => 'Chartbeat UID', 'id' => THEME_OPTIONS_NAME . '[cb_uid]', 'description' => 'Example: <em>1842</em>', 'default' => null, 'value' => $theme_options['cb_uid'])), new TextField(array('name' => 'Chartbeat Domain', 'id' => THEME_OPTIONS_NAME . '[cb_domain]', 'description' => 'Example: <em>some.domain.com</em>', 'default' => null, 'value' => $theme_options['cb_domain']))), 'Search' => array(new RadioField(array('name' => 'Enable Google Search', 'id' => THEME_OPTIONS_NAME . '[enable_google]', 'description' => 'Enable to use the google search appliance to power the search functionality.', 'default' => 1, 'choices' => array('On' => 1, 'Off' => 0), 'value' => $theme_options['enable_google'])), new TextField(array('name' => 'Search Domain', 'id' => THEME_OPTIONS_NAME . '[search_domain]', 'description' => 'Domain to use for the built-in google search.  Useful for development or if the site needs to search a domain other than the one it occupies. Example: <em>some.domain.com</em>', 'default' => null, 'value' => $theme_options['search_domain'])), new TextField(array('name' => 'Search Results Per Page', 'id' => THEME_OPTIONS_NAME . '[search_per_page]', 'description' => 'Number of search results to show per page of results', 'default' => 10, 'value' => $theme_options['search_per_page']))), 'Site' => array(new SelectField(array('name' => 'Featured Front Page Story', 'id' => THEME_OPTIONS_NAME . '[front_page_story]', 'description' => 'This story will be excluded from the front page\'s footer navigation.', 'value' => $theme_options['front_page_story'], 'default' => '', 'choices' => get_front_page_story_choices()))), 'Social' => array(new RadioField(array('name' => 'Enable OpenGraph', 'id' => THEME_OPTIONS_NAME . '[enable_og]', 'description' => 'Turn on the opengraph meta information used by Facebook.', 'default' => 1, 'choices' => array('On' => 1, 'Off' => 0), 'value' => $theme_options['enable_og'])), new TextField(array('name' => 'Facebook Admins', 'id' => THEME_OPTIONS_NAME . '[fb_admins]', 'description' => 'Comma seperated facebook usernames or user ids of those responsible for administrating any facebook pages created from pages on this site. Example: <em>592952074, abe.lincoln</em>', 'default' => null, 'value' => $theme_options['fb_admins'])), new TextField(array('name' => 'Facebook URL', 'id' => THEME_OPTIONS_NAME . '[facebook_url]', 'description' => 'URL to the facebook page you would like to direct visitors to.  Example: <em>https://www.facebook.com/CSBrisketBus</em>', 'default' => null, 'value' => $theme_options['facebook_url'])), new TextField(array('name' => 'Twitter URL', 'id' => THEME_OPTIONS_NAME . '[twitter_url]', 'description' => 'URL to the twitter user account you would like to direct visitors to.  Example: <em>http://twitter.com/csbrisketbus</em>', 'value' => $theme_options['twitter_url'])), new RadioField(array('name' => 'Enable Flickr', 'id' => THEME_OPTIONS_NAME . '[enable_flickr]', 'description' => 'Automatically display flickr images throughout the site', 'default' => 1, 'choices' => array('On' => 1, 'Off' => 0), 'value' => $theme_options['enable_flickr'])), new TextField(array('name' => 'Flickr Photostream ID', 'id' => THEME_OPTIONS_NAME . '[flickr_id]', 'description' => 'ID of the flickr photostream you would like to show pictures from.  Example: <em>65412398@N05</em>', 'default' => '36226710@N08', 'value' => $theme_options['flickr_id'])), new SelectField(array('name' => 'Flickr Max Images', 'id' => THEME_OPTIONS_NAME . '[flickr_max_items]', 'description' => 'Maximum number of flickr images to display', 'value' => $theme_options['flickr_max_items'], 'default' => 12, 'choices' => array('6' => 6, '12' => 12, '18' => 18)))), 'Devices' => array(new TextField(array('name' => 'iTunes Store iPad App URL', 'id' => THEME_OPTIONS_NAME . '[ipad_app_url]', 'description' => 'URL of the Pegasus Magazine iPad app in the iTunes store. Used for the iPad modal. The modal and footer link will not be displayed if this field is blank.', 'default' => '', 'value' => $theme_options['ipad_app_url']))), 'Styles' => array(new RadioField(array('name' => 'Enable Responsiveness', 'id' => THEME_OPTIONS_NAME . '[bootstrap_enable_responsive]', 'description' => 'Turn on responsive styles provided by the Twitter Bootstrap framework.  This setting should be decided upon before building out subpages, etc. to ensure content is designed to shrink down appropriately.  Turning this off will enable the single 940px-wide Bootstrap layout.', 'default' => 1, 'choices' => array('On' => 1, 'Off' => 0), 'value' => $theme_options['bootstrap_enable_responsive']))));
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('admin' => True, 'src' => THEME_CSS_URL . '/admin.css'), THEME_STATIC_URL . '/bootstrap/css/bootstrap.css');
if ($theme_options['bootstrap_enable_responsive'] == 1) {
    array_push(Config::$styles, THEME_STATIC_URL . '/bootstrap/css/bootstrap-responsive.css');
}
array_push(Config::$styles, plugins_url('gravityforms/css/forms.css'), get_bloginfo('stylesheet_url'));
if ($theme_options['bootstrap_enable_responsive'] == 1) {
    array_push(Config::$styles, THEME_URL . '/style-responsive.css');
}
Config::$scripts = array(array('admin' => True, 'src' => THEME_JS_URL . '/admin.js'), THEME_STATIC_URL . '/bootstrap/js/bootstrap.js', THEME_STATIC_URL . '/js/jquery.cookie.js', array('name' => 'base-script', 'src' => THEME_JS_URL . '/webcom-base.js'), array('name' => 'theme-script', 'src' => THEME_JS_URL . '/script.js'), array('name' => 'rgraph-effects', 'src' => THEME_JS_URL . '/rgraph/RGraph.common.effects.js'), array('name' => 'rgraph-core', 'src' => THEME_JS_URL . '/rgraph/RGraph.common.core.js'), array('name' => 'rgraph-tooltips', 'src' => THEME_JS_URL . '/rgraph/RGraph.common.tooltips.js'), array('name' => 'rgraph-key', 'src' => THEME_JS_URL . '/rgraph/RGraph.common.key.js'), array('name' => 'rgraph-dynamic', 'src' => THEME_JS_URL . '/rgraph/RGraph.common.dynamic.js'), array('name' => 'rgraph-line', 'src' => THEME_JS_URL . '/rgraph/RGraph.line.js'), array('name' => 'inview', 'src' => THEME_JS_URL . '/inview.js'));
Config::$metas = array(array('charset' => 'utf-8'));
if ($theme_options['gw_verify']) {
    Config::$metas[] = array('name' => 'google-site-verification', 'content' => htmlentities($theme_options['gw_verify']));
}
function jquery_in_header()
{
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'http://code.jquery.com/jquery-1.7.1.min.js');
    wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'jquery_in_header');