'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' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar 2', 'spun' ), 'id' => 'sidebar-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar 3', 'spun' ), 'id' => 'sidebar-3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'spun_widgets_init' ); /** * Enqueue scripts and styles */ function spun_scripts() { wp_enqueue_style( 'style', get_stylesheet_uri() ); wp_enqueue_script( 'spun-toggle', get_template_directory_uri() . '/js/toggle.js', array( 'jquery' ), '20121005', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } wp_enqueue_style( 'spun-quicksand' ); wp_enqueue_style( 'spun-playfair' ); wp_enqueue_style( 'spun-nunito' ); } add_action( 'wp_enqueue_scripts', 'spun_scripts', 1 ); /* * Change the theme's accent color * Not yet working with the Customizer * @todo find a way to reset to default values * / function spun_custom_color() { //If a custom accent color is set, use it! if ( '' != get_theme_mod( 'spun_color' ) ) { $color = esc_html( get_theme_mod( 'spun_color' ) ); ?> add_setting( 'spun_color', array( 'default' => '', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'spun_color', array( 'label' => 'Accent Color', 'section' => 'colors', 'default' => '', ) ) ); } add_action( 'customize_register', 'spun_customize' );*/