= 2 || $page >= 2) $title = "$title $sep " . sprintf( __('Page %s', 'alphaforte'), max($paged, $page)); return $title; } add_filter('wp_title', 'alphaforte_wp_title', 10, 2); // load styles function alphaforte_styles() { wp_register_style('sourceSans', 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'); wp_register_style('openSans', 'http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700'); wp_enqueue_style('bootstrap', get_template_directory_uri() . '/assets/bootstrap.min.css'); wp_enqueue_style('sourceSans'); wp_enqueue_style('openSans'); wp_enqueue_style('alphaforte_style', get_stylesheet_uri()); } add_action('wp_enqueue_scripts', 'alphaforte_styles'); // load javascript function alphaforte_scripts() { if(!is_admin()){ wp_enqueue_script('jquery'); wp_enqueue_script('alphaforte_scripts', get_template_directory_uri() . '/assets/scripts.js'); } if (is_singular()) wp_enqueue_script('comment-reply'); } add_action('wp_enqueue_scripts', 'alphaforte_scripts'); // register widgets function alphaforte_widgets_init() { register_sidebar(array( 'name' => __('Left Sidebar', 'alphaforte'), 'id' => 'left-sidebar', 'description' => __('Widgets in this area will appear in the left hand sidebar on all pages and posts.', 'alphaforte'), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => __('Right Sidebar', 'alphaforte'), 'id' => 'right-sidebar', 'description' => __('Widgets in this area will appear in the right hand sidebar on all pages and posts.', 'alphaforte'), 'before_widget' => '", 'before_title' => '

', 'after_title' => '

' )); } add_action('widgets_init', 'alphaforte_widgets_init'); // display page numbers on teasers if (!function_exists('alphaforte_pagination')): function alphaforte_pagination() { global $wp_query; $big = 999999999; echo paginate_links( array( 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages )); } endif; // custom background image function alphaforte_theme_customizer($wp_customize) { $wp_customize->add_section('alphaforte_background_section', array( 'title' => __('Custom Background', 'alphaforte'), 'priority' => 999, 'description' => 'Upload a custom background image.' )); $wp_customize->add_setting('alphaforte_background'); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'alphaforte_background', array( 'label' => __('Image', 'alphaforte'), 'section' => 'alphaforte_background_section', 'settings' => 'alphaforte_background' ))); } add_action('customize_register', 'alphaforte_theme_customizer'); function alphaforte_background() { if (get_theme_mod('alphaforte_background')): ?> $.backstretch(''); $.backstretch('/img/bg.jpg');