'main', 'footer' => 'page', 'render' => 'sapor_infinite_scroll_render', ) ); add_theme_support( 'jetpack-responsive-videos' ); add_image_size( 'sapor-logo', 260, 260 ); add_theme_support( 'site-logo', array( 'size' => 'sapor-logo' ) ); add_theme_support( 'jetpack-content-options', array( 'blog-display' => array( 'content', 'excerpt', ), 'author-bio' => true, 'post-details' => array( 'stylesheet' => 'sapor-style', 'date' => '.posted-on', 'categories' => '.cat-links', 'tags' => '.tags-links', 'author' => '.byline', ), 'featured-images' => array( 'archive' => true, 'post' => true, 'page' => true, 'fallback' => true, 'fallback-default' => false, ), ) ); } add_action( 'after_setup_theme', 'sapor_jetpack_setup' ); /* Render Infinite Scroll Items */ function sapor_infinite_scroll_render() { while ( have_posts() ) { the_post(); if ( is_search() ) : get_template_part( 'template-parts/content', 'search' ); else : get_template_part( 'template-parts/content', get_post_format() ); endif; } } // end function sapor_infinite_scroll_render /** * Return early if Site Logo is not available. * * @since Sapor 1.0 */ function sapor_the_site_logo() { if ( ! function_exists( 'jetpack_the_site_logo' ) ) { return; } else { jetpack_the_site_logo(); } } /** * Return early if Author Bio is not available. */ function sapor_author_bio() { if ( ! function_exists( 'jetpack_author_bio' ) ) { if ( '' != get_the_author_meta( 'description' ) ) { get_template_part( 'author-bio' ); } else { return; } } else { jetpack_author_bio(); } } /** * Author Bio Avatar Size. */ function sapor_author_bio_avatar_size() { return 50; } add_filter( 'jetpack_author_bio_avatar_size', 'sapor_author_bio_avatar_size' ); /** * Load Jetpack sharing buttons and likes. */ function sapor_post_flair() { // Sharing buttons if ( function_exists( 'sharing_display' ) ) { sharing_display( '', true ); } // Likes if ( class_exists( 'Jetpack_Likes' ) ) { $custom_likes = new Jetpack_Likes; echo $custom_likes->post_likes( '' ); } } /** * Remove sharedaddy from excerpt. */ function sapor_remove_sharedaddy() { remove_filter( 'the_excerpt', 'sharing_display', 19 ); } add_action( 'loop_start', 'sapor_remove_sharedaddy' ); /** * Custom function to check for a post thumbnail; * If Jetpack is not available, fall back to has_post_thumbnail() */ function sapor_has_post_thumbnail( $post = null ) { if ( function_exists( 'jetpack_has_featured_image' ) ) { return jetpack_has_featured_image( $post ); } else { return has_post_thumbnail( $post ); } }