'content', 'footer' => 'page', 'render' => 'spun_infinite_scroll', 'posts_per_page' => 15, 'footer_widgets' => array( 'sidebar-1', 'sidebar-2', 'sidebar-3' ), ) ); /* Load the proper content template */ function spun_infinite_scroll() { while( have_posts() ) { the_post(); get_template_part( 'content', 'home' ); } } /** * Make theme available for translation * Translations can be filed in the /languages/ directory * If you're building a theme based on Spun, use a find and replace * to change 'spun' to the name of your theme in all the template files */ load_theme_textdomain( 'spun', get_template_directory() . '/languages' ); /** * Add default posts and comments RSS feed links to head */ add_theme_support( 'automatic-feed-links' ); /** * Enable support for Post Thumbnails */ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 360, 360, true ); add_image_size( 'single-post', 700, 467, true ); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'spun' ), ) ); /** * Add support for custom backgrounds */ add_theme_support( 'custom-background' ); /** * Add support for Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'gallery', 'image', 'quote', 'status' ) ); } endif; // spun_setup add_action( 'after_setup_theme', 'spun_setup' ); /* Filter to add author credit to Infinite Scroll footer */ function spun_footer_credits( $credit ) { $credit = sprintf( __( '%3$s | Theme: %1$s by %2$s.', 'spun' ), 'Spun', 'Caroline Moore', 'Proudly powered by WordPress' ); return $credit; } add_filter( 'infinite_scroll_credit', 'spun_footer_credits' ); /** * Filter archives to display one less post per page to account for the .page-title circle */ function limit_posts_per_archive_page() { if ( ! is_home() && is_archive() || is_search() ) { $posts_per_page = intval( get_option( 'posts_per_page' ) ) - 1; set_query_var( 'posts_per_page', $posts_per_page ); } } add_filter( 'pre_get_posts', 'limit_posts_per_archive_page' ); /** * Register widgetized area and update sidebar with default widgets * * @since Spun 1.0 */ function spun_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar 1', 'spun' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '