array( 'site-title', 'site-description', ), 'size' => 'dyad-site-logo', ) ); //Featured content add_theme_support( 'featured-content' , array( 'featured_content_filter' => 'dyad_get_banner_posts', 'max_posts' => 6, 'post_types' => array( 'post' ), ) ); //Infinite scroll add_theme_support( 'infinite-scroll', array( 'container' => 'posts', 'footer' => 'primary', 'footer_widgets' => array( 'sidebar-1'), 'render' => 'dyad_infinite_scroll_render', 'wrapper' => false, 'posts_per_page' => 12, ) ); //Content options add_theme_support( 'jetpack-content-options', array( 'post-details' => array( 'stylesheet' => 'dyad-style', 'date' => '.posted-on', 'categories' => '.cat-links', 'tags' => '.tags-links', 'author' => '.byline, .date-published-word', ), 'featured-images' => array( 'archive' => true, 'post' => true, 'page' => true, ), ) ); } } // /dyad_jetpack add_action( 'after_setup_theme', 'dyad_jetpack' ); /** * Custom render function for Infinite Scroll. */ function dyad_infinite_scroll_render() { while ( have_posts() ) { the_post(); get_template_part( 'template-parts/content', 'blocks' ); } } // end function dyad_infinite_scroll_render /** * Getter function for Featured Content. * See http://jetpack.me/support/featured-content/ */ function dyad_get_banner_posts() { return apply_filters( 'dyad_get_banner_posts', array() ); } /** * Check for minimum number of featured posts */ function dyad_has_banner_posts( $minimum = 1 ) { $minimum = absint( $minimum ); $featured_posts = apply_filters( 'dyad_get_banner_posts', array() ); if ( ! is_array( $featured_posts ) ) { return false; } if ( $minimum > count( $featured_posts ) ) { return false; } return true; } /** * Show/Hide Featured Image on single posts view outside of the loop. */ function dyad_jetpack_featured_image_display() { if ( ! function_exists( 'jetpack_featured_images_remove_post_thumbnail' ) ) { return true; } else { $options = get_theme_support( 'jetpack-content-options' ); $featured_images = ( ! empty( $options[0]['featured-images'] ) ) ? $options[0]['featured-images'] : null; $settings = array( 'post-default' => ( isset( $featured_images['post-default'] ) && false === $featured_images['post-default'] ) ? '' : 1, 'page-default' => ( isset( $featured_images['page-default'] ) && false === $featured_images['page-default'] ) ? '' : 1, ); $settings = array_merge( $settings, array( 'post-option' => get_option( 'jetpack_content_featured_images_post', $settings['post-default'] ), 'page-option' => get_option( 'jetpack_content_featured_images_page', $settings['page-default'] ), ) ); if ( ( ! $settings['post-option'] && is_single() ) || ( ! $settings['page-option'] && is_singular() && is_page() ) ) { return false; } else { return true; } } }