'scroll', 'footer_widgets' => array( 'footer-1', 'footer-2', 'footer-3' ), 'container' => 'content', 'footer' => 'main', ) ); /** * This theme uses wp_nav_menu() in one location. */ register_nav_menus( array( 'primary' => __( 'Primary Menu', 'book-lite' ), ) ); /** * Add support for required post formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); /** * Add support for custom backgrounds */ add_theme_support( 'custom-background' ); } endif; // book_lite_setup add_action( 'after_setup_theme', 'book_lite_setup' ); /** * Register widgetized area and update sidebar with default widgets * * @since Book Lite 1.0 */ function book_lite_widgets_init() { register_sidebar( array( 'name' => __( 'Footer One', 'booklite' ), 'id' => 'footer-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Two', 'booklite' ), 'id' => 'footer-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Three', 'booklite' ), 'id' => 'footer-3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'book_lite_widgets_init' ); /** * Enqueue scripts and styles */ function book_lite_scripts() { wp_enqueue_style( 'book-lite-style', get_stylesheet_uri() ); wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '20120206', 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' ); } add_action( 'wp_enqueue_scripts', 'book_lite_scripts' ); /** * Enqueue sidebar styles, which change widths depending on the number of sidebars present */ function book_lite_sidebar_styles() { if ( ! is_active_sidebar( 'footer-1' ) && ! is_active_sidebar( 'footer-2' ) && ! is_active_sidebar( 'footer-3' ) ) return; $num_sidebars = 0; if ( is_active_sidebar( 'footer-1' ) ) $num_sidebars++; if ( is_active_sidebar( 'footer-2' ) ) $num_sidebars++; if ( is_active_sidebar( 'footer-3' ) ) $num_sidebars++; switch( $num_sidebars ) : case 1: $width = '100%'; break; case 2: $width = '49%'; break; default: $width = '32%'; endswitch; ?>