= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'bodyhealth' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'bodyhealth_wp_title', 10, 2 ); function bodyhealth_widgets_init() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'bodyhealth' ), 'id' => 'sidebar-1', 'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'First Front Page Widget Area', 'bodyhealth' ), 'id' => 'sidebar-2', 'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } function theme_name_script() { wp_enqueue_style( 'bodyhealth-bootstrap-style', get_template_directory_uri().'/css/bootstrap.css' ); wp_enqueue_style( 'bodyhealth-sheet-style', get_template_directory_uri().'/css/style.css' ); wp_enqueue_style( 'bodyhealth-red-style', get_template_directory_uri().'/css/red.css' ); wp_enqueue_style( 'bodyhealth-switch', get_template_directory_uri().'/styleswitcher/style-switcher.css' ); wp_enqueue_style( 'bodyhealth-style', get_template_directory_uri().'/style.css' ); wp_register_script( 'script-name', get_template_directory_uri() . '/js/jquery-1.9.0.js', array('jquery'), '1.9.0', true ); wp_enqueue_script('script-name'); wp_register_script( 'script-boot', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '1.0', true ); wp_enqueue_script('script-boot'); wp_register_script( 'script-validate', get_template_directory_uri() . '/js/jquery.validate.min.js', array('jquery'), '1.1', true ); wp_enqueue_script('script-validate'); wp_register_script( 'script-app', get_template_directory_uri() . '/js/app.js', array('jquery'), '1.3', true ); wp_enqueue_script('script-app'); wp_register_script( 'script-swicth', get_template_directory_uri() . '/styleswitcher/style-switcher.js', array('jquery'), '1.4', true ); wp_enqueue_script('script-swicth'); } add_action( 'init', 'theme_name_script' ); add_action( 'widgets_init', 'bodyhealth_widgets_init' ); function register_menu() { register_nav_menus( array( 'main_menu' => 'main navigation', ) ); } if ( ! isset( $content_width ) ) $content_width = 980; add_action( 'init', 'register_menu' ); add_theme_support('post-thumbnails'); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'custom-header'); add_theme_support( 'custom-background'); function custom_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); if ( is_singular() ) wp_enqueue_script( "comment-reply" );