/** * Enqueue scripts. */ function eighties_scripts() { // If script debug is true, do not serve minified scripts. $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.js' : '.min.js'; // Our scripts. $scripts = array('backstretch' => array('deps' => array('jquery'), 'version' => '2.0.4', 'footer' => true), 'fitvids' => array('deps' => array('jquery'), 'version' => '1.0.3', 'footer' => true), 'eighties' => array('deps' => array('fitvids'), 'version' => '20140711', 'footer' => true), 'eighties-enable-js' => array('deps' => false, 'version' => '20140711', 'footer' => false), 'eighties-blog' => array('deps' => array('backstretch'), 'version' => '20140711', 'footer' => true), 'eighties-portfolio' => array('deps' => array('jquery'), 'version' => '20140711', 'footer' => true), 'eighties-header' => array('deps' => array('backstretch'), 'version' => '20140711', 'footer' => true), 'skip-link-focus-fix' => array('deps' => false, 'version' => '20140711', 'footer' => true)); // Foreach of the scripts, let's register them. foreach ($scripts as $script => $args) { wp_register_script($script, get_template_directory_uri() . '/js/' . $script . $suffix, $args['deps'], $args['version'], $args['footer']); } // Change no-js to js on the documentElement. wp_enqueue_script('eighties-enable-js'); // Enqueue global (includes navigation and others). wp_enqueue_script('eighties'); // Skip link focus. wp_enqueue_script('skip-link-focus-fix'); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } if (is_home() || is_archive() || is_search()) { wp_enqueue_script('eighties-blog'); } if (is_post_type_archive('jetpack-portfolio')) { wp_enqueue_script('eighties-portfolio'); } if (eighties_header_image()) { wp_enqueue_script('eighties-header'); } }
/** * Styles the header image and text displayed on the blog * * @see eighties_custom_header_setup(). */ function eighties_header_style() { $header_text_color = get_header_textcolor(); $header_image = eighties_header_image(); $header = get_custom_header(); // If no custom options for text are set, let's bail // get_header_textcolor() options: HEADER_TEXTCOLOR is default, hide text (returns 'blank') or any hex value if (HEADER_TEXTCOLOR == $header_text_color && !$header_image) { return; } // If we get this far, we have custom styles. Let's do this. ?> <style type="text/css"> <?php // Has the text been hidden? if ('blank' == $header_text_color) { ?> .site-title, .site-description { position: absolute; clip: rect(1px, 1px, 1px, 1px); } <?php // If the user has set a custom color for the text use that } else { ?> .site-title a, .site-description { color: #<?php echo $header_text_color; ?> ; } <?php } ?> <?php // We have a header image, let's do something with it. if ($header_image) { ?> #masthead { background-image: url('<?php echo $header_image; ?> '); background-position: center center; background-repeat: no-repeat; background-size: cover; } <?php } ?> <?php if ('blank' == get_header_textcolor()) { ?> <?php // If the header height is different than 600, let's calculate a padding. if (600 != $header->height) { ?> .site-branding { padding: <?php echo $header->height / 2 / 16; ?> em 0; } <?php } else { ?> .site-branding { padding: 18.75em 0; } <?php } ?> <?php } else { ?> <?php // If the header height is different than 600, let's calculate a padding. if (600 != $header->height) { ?> .site-branding { padding: <?php echo $header->height / 4 / 16; ?> em 0; } <?php } ?> <?php } ?> </style> <?php }
?> </h4> <?php wp_nav_menu(array('theme_location' => 'primary')); ?> <?php wp_nav_menu(array('theme_location' => 'social', 'menu_class' => 'menu menu-social', 'link_before' => '<span class="screen-reader-text">', 'link_after' => '</span>', 'fallback_cb' => false)); ?> </nav><!-- #site-navigation --> <?php if (eighties_header_image() || get_theme_mod('header_textcolor') !== 'blank') { ?> <header id="masthead" class="site-header" role="banner"> <a class="skip-link screen-reader-text" href="#content" <?php echo eighties_header_image() ? 'data-backstretch="' . eighties_header_image() . '"' : ''; ?> ><?php _e('Skip to content', 'eighties'); ?> </a> <div class="site-branding"> <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?> " rel="home"><?php bloginfo('name'); ?> </a></h1> <h2 class="site-description"><?php bloginfo('description');