= 2 || $page >= 2) $title = "$title $sep " . sprintf( __('Page %s', 'alphasource'), max($paged, $page)); return $title; } add_filter( 'wp_title', 'alphasource_wp_title', 10, 2 ); // load style sheets function alphasource_styles() { if (is_front_page()) { wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Sansita+One'); wp_enqueue_style( 'googleFonts'); } wp_enqueue_style('style', get_stylesheet_uri()); } add_action('wp_enqueue_scripts', 'alphasource_styles'); // load javascript function alphasource_scripts() { if(!is_admin()){ wp_enqueue_script('jquery'); wp_enqueue_script('scripts', get_template_directory_uri() . '/assets/scripts.js'); } } add_action('wp_enqueue_scripts', 'alphasource_scripts'); //register footer and sidebar widgets function alphasource_widgets_init() { register_sidebar(array( 'name' => __('Footer Left', 'alphasource'), 'id' => 'footer-left', 'description' => __('Widgets in this area will be shown in the left column of the footer.', 'alphasource'), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => __('Footer Middle', 'alphasource'), 'id' => 'footer-middle', 'description' => __('Widgets in this area will be shown in the middle column of the footer.', 'alphasource'), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => __('Footer Right', 'alphasource'), 'id' => 'footer-right', 'description' => __('Widgets in this area will be shown in the right column of the footer.', 'alphasource'), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => __('Posts Sidebar', 'alphasource'), 'id' => 'post-sidebar', 'description' => __('Widgets in this area will be shown on posts in the right sidebar', 'alphasource'), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

' )); } add_action('widgets_init', 'alphasource_widgets_init'); // custom home page header and logo function alphasource_theme_customizer($wp_customize) { // custom logo $wp_customize->add_section('alphasource_logo_section', array( 'title' => __('Custom Logo', 'alphasource'), 'priority' => 999, 'description' => 'Upload a logo to replace the site name text on the home page.' )); $wp_customize->add_setting('alphasource_logo'); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'alphasource_logo', array( 'label' => __('Image', 'alphasource'), 'section' => 'alphasource_logo_section', 'settings' => 'alphasource_logo' ))); //custom home page header $wp_customize->add_section('alphasource_header_section', array( 'title' => __('Custom Header Background', 'alphasource'), 'priority' => 999, 'description' => 'Upload a custom header background image that appears on the home page.' )); $wp_customize->add_setting('alphasource_header'); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'alphasource_header', array( 'label' => __('Image', 'alphasource'), 'section' => 'alphasource_header_section', 'settings' => 'alphasource_header' ))); } add_action('customize_register', 'alphasource_theme_customizer'); ?>