'main', 'render' => 'rivet_infinite_scroll_render', 'footer' => 'page', 'wrapper' => false, 'footer_widgets' => array( 'sidebar-1', 'sidebar-2', 'sidebar-3' ), ) ); // Add theme support for Responsive Videos. add_theme_support( 'jetpack-responsive-videos' ); // Add theme support for Content Options. add_theme_support( 'jetpack-content-options', array( 'author-bio' => true, 'avatar-default' => false, 'post-details' => array( 'stylesheet' => 'rivet-style', 'date' => '.posted-on', 'categories' => '.cat-links', 'tags' => '.tags-links', 'author' => '.byline', 'comment' => '.comments-link', ), 'featured-images' => array( 'archive' => true, 'post' => true, 'page' => true, 'fallback' => true, 'fallback-default' => false, ), ) ); // Add theme support for Social Menus add_theme_support( 'jetpack-social-menu', 'svg' ); } add_action( 'after_setup_theme', 'rivet_jetpack_setup' ); /** * Custom render function for Infinite Scroll. */ function rivet_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; } } /** * Custom function to check for a post thumbnail; * If Jetpack is not available, fall back to has_post_thumbnail() */ function rivet_has_post_thumbnail( $post = null ) { if ( function_exists( 'jetpack_has_featured_image' ) ) { return jetpack_has_featured_image( $post ); } else { return has_post_thumbnail( $post ); } } /** * Return early if Author Bio is not available. */ function rivet_author_bio() { if ( ! function_exists( 'jetpack_author_bio' ) ) { get_template_part( 'template-parts/content', 'author' ); } else { jetpack_author_bio(); } } /** * Author Bio Avatar Size. */ function rivet_author_bio_avatar_size() { return 60; // in px } add_filter( 'jetpack_author_bio_avatar_size', 'rivet_author_bio_avatar_size' ); /** * Custom function to get the URL of a post thumbnail; * If Jetpack is not available, fall back to wp_get_attachment_image_src() */ function rivet_get_attachment_image_src( $post_id, $post_thumbnail_id, $size ) { if ( function_exists( 'jetpack_featured_images_fallback_get_image_src' ) ) { return jetpack_featured_images_fallback_get_image_src( $post_id, $post_thumbnail_id, $size ); } else { $attachment = wp_get_attachment_image_src( $post_thumbnail_id, $size ); // Attachment array $url = $attachment[0]; // Attachment URL return $url; } } /** * Return early if Social Menu is not available. */ function rivet_social_menu() { if ( ! function_exists( 'jetpack_social_menu' ) ) { return; } else { jetpack_social_menu(); } } // First, make sure Jetpack doesn't concatenate all its CSS add_filter( 'rivet_css', '__return_false' ); // Then, remove each CSS file, one at a time function rivet_remove_all_jp_css() { //wp_deregister_style( 'AtD_style' ); // After the Deadline //wp_deregister_style( 'jetpack_likes' ); // Likes //wp_deregister_style( 'jetpack_related-posts' ); //Related Posts //wp_deregister_style( 'jetpack-carousel' ); // Carousel wp_deregister_style( 'grunion.css' ); // Grunion contact form //wp_deregister_style( 'the-neverending-homepage' ); // Infinite Scroll //wp_deregister_style( 'infinity-twentyten' ); // Infinite Scroll - Twentyten Theme //wp_deregister_style( 'infinity-twentyeleven' ); // Infinite Scroll - Twentyeleven Theme //wp_deregister_style( 'infinity-twentytwelve' ); // Infinite Scroll - Twentytwelve Theme //wp_deregister_style( 'noticons' ); // Notes //wp_deregister_style( 'post-by-email' ); // Post by Email //wp_deregister_style( 'publicize' ); // Publicize //wp_deregister_style( 'sharedaddy' ); // Sharedaddy //wp_deregister_style( 'sharing' ); // Sharedaddy Sharing wp_deregister_style( 'jetpack-social-menu-css' ); // Social menu //wp_deregister_style( 'stats_reports_css' ); // Stats //wp_deregister_style( 'jetpack-widgets' ); // Widgets //wp_deregister_style( 'jetpack-slideshow' ); // Slideshows //wp_deregister_style( 'presentations' ); // Presentation shortcode //wp_deregister_style( 'jetpack-subscriptions' ); // Subscriptions //wp_deregister_style( 'tiled-gallery' ); // Tiled Galleries //wp_deregister_style( 'widget-conditions' ); // Widget Visibility //wp_deregister_style( 'jetpack_display_posts_widget' ); // Display Posts Widget //wp_deregister_style( 'gravatar-profile-widget' ); // Gravatar Widget //wp_deregister_style( 'widget-grid-and-list' ); // Top Posts widget //wp_deregister_style( 'jetpack-widgets' ); // Widgets } add_action('wp_print_styles', 'rivet_remove_all_jp_css' );