function dyad_body_classes($classes) { global $post; // Adds a class of group-blog to blogs with more than 1 published author. if (is_multi_author()) { $classes[] = 'group-blog'; } //Singular? if (is_singular()) { $classes[] = 'is-singular'; } //Has featured image? if (has_post_thumbnail($post->ID)) { $classes[] = 'has-post-thumbnail'; } $header_image = get_header_image(); if (!dyad_has_banner_posts(1) && (is_home() || is_archive() || is_search()) && '' == $header_image) { $classes[] = 'no-featured-posts'; } $classes[] = 'no-js'; return $classes; }
/** * Enqueue scripts and styles. */ function dyad_scripts() { wp_enqueue_style('genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.2'); wp_enqueue_style('dyad-fonts', dyad_fonts_url(), array(), null); wp_enqueue_script('imagesloaded', get_template_directory_uri() . '/js/imagesloaded.pk.js', array('jquery'), '20151006', true); wp_enqueue_script('dyad-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true); wp_enqueue_script('dyad-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true); if ((is_front_page() || is_home()) && dyad_has_banner_posts(2)) { wp_enqueue_script('slick', get_template_directory_uri() . '/js/slick.js', array(), '20140523', true); } if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_enqueue_style('dyad-style', get_stylesheet_uri()); wp_enqueue_script('dyad-global', get_template_directory_uri() . '/js/global.js', array('jquery', 'masonry'), '20151204', true); }
if ((is_front_page() || is_home()) && dyad_has_banner_posts(2)) { echo ' enable-slider'; } else { echo ' no-slider'; } ?> "> <div class="site-banner-inner"> <?php if (is_front_page() && is_page() && has_post_thumbnail() || is_single() && 'image' == get_post_format()) { // if front page is static page or if this is single image post and has a featured image, display that. get_template_part('template-parts/content', 'featured-img'); } else { if (dyad_has_banner_posts(1)) { // if there are featured posts, display those as a slideshow $featured_posts = dyad_get_banner_posts(); foreach ((array) $featured_posts as $order => $post) { setup_postdata($post); get_template_part('template-parts/content', 'featured-post'); } wp_reset_postdata(); } else { //Fall back to Custom Header get_template_part('template-parts/content', 'custom-header'); } } ?> </div><!-- .site-banner-inner -->