'#f563d8', 'default-image' => '', ) ); /** * Add theme support for Infinite Scroll. * See: http://jetpack.me/support/infinite-scroll/ */ add_theme_support( 'infinite-scroll', array( 'container' => 'content', 'footer' => 'page', ) ); } endif; // novus_setup add_action( 'after_setup_theme', 'novus_setup' ); /** * Register widgetized area and update sidebar with default widgets */ function novus_widgets_init() { register_sidebar( array( 'name' => __( 'Footer', 'novus' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'novus_widgets_init' ); /** * Enqueue scripts and styles */ function novus_scripts() { wp_enqueue_style( 'Novus-style', get_stylesheet_uri() ); wp_enqueue_script( 'Novus', get_template_directory_uri() . '/js/novus.js', array( 'jquery' ), '1.0', 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( 'Novus-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'novus_scripts' ); function novus_customize_register( $customizer ) { $customizer->add_setting( 'logo' ); $customizer->add_control( new WP_Customize_Image_Control( $customizer, 'logo', array( 'label' => __( 'Logo', 'novus' ), 'section' => 'title_tagline', ) ) ); $customizer->add_section( 'layouts', array( 'title' => __( 'Layout', 'novus' ), 'priority' => 40 ) ); $customizer->add_setting( 'site_width', array( 'default' => 600 ) ); $customizer->add_control( 'site_width', array( 'label' => __( 'Site width', 'novus' ), 'section' => 'layouts', 'type' => 'text' ) ); } add_action( 'customize_register', 'novus_customize_register' ); function novus_inline_styles() { /* set the logo */ $logo = get_theme_mod( 'logo' ); if( '' == $logo ) $logo = trailingslashit( get_template_directory_uri() ) . 'images/logo.png'; list( $width, $height ) = @getimagesize( $logo ); $css = ".site-title a { display: block; background: url('{$logo}') no-repeat; overflow: hidden; text-indent: -9999px; width: {$width}px; height: {$height}px; }"; /* adjust the page shadow position */ $height += 20; $css .= ".site{ background-position: 45px {$height}px }"; /* use the icons from the admin dashboard for post formats 0-o */ $css .= '.post-icon { background-image: url("' . admin_url( 'images/post-formats32.png' ) . '"); }'; $css .= '.site { width: ' . get_theme_mod( 'site_width', 600 ) . 'px; }'; echo ''; } add_action( 'wp_head', 'novus_inline_styles' ); /** * Returns number of widgets in a widget position * * @since 1.0 * @return int */ function novus_position_count( $position ) { $sidebar_widgets = wp_get_sidebars_widgets(); if( isset( $sidebar_widgets[$position] ) ) { return count( $sidebar_widgets[$position] ); } return 0; }