Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( ! isset( $content_width ) ) $content_width = 600;
- function newtek_wp_title( $title ) {
- global $page, $paged;
- if ( is_feed() )
- return $title;
- $site_description = get_bloginfo( 'description' );
- $filtered_title = $title . get_bloginfo( 'name' );
- $filtered_title .= ( ! empty( $site_description ) && ( is_home() || is_front_page() ) ) ? ' | ' . $site_description: '';
- $filtered_title .= ( 2 <= $paged || 2 <= $page ) ? ' | ' . sprintf( __( 'Page %s', 'newtek' ), max( $paged, $page ) ) : '';
- return $filtered_title;
- }
- add_filter( 'wp_title', 'newtek_wp_title' );
- function newtek_widgets_init() {
- register_sidebar( array(
- 'name' => 'Home right sidebar',
- 'id' => 'home_right_1',
- 'before_widget' => '',
- 'after_widget' => '<br />',
- 'before_title' => '<h5 class="sidebarhd">',
- 'after_title' => '</h5>',
- ) );
- register_sidebar( array(
- 'name' => 'Footer Sidebar 1',
- 'id' => 'footer-sidebar-1',
- 'description' => 'Appears in the footer area',
- 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
- 'after_widget' => '</aside>',
- 'before_title' => '<h3 class="sidebarhd2">',
- 'after_title' => '</h3>',
- ) );
- register_sidebar( array(
- 'name' => 'Footer Sidebar 2',
- 'id' => 'footer-sidebar-2',
- 'description' => 'Appears in the footer area',
- 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
- 'after_widget' => '</aside>',
- 'before_title' => '<h3 class="sidebarhd2">',
- 'after_title' => '</h3>',
- ) );
- register_sidebar( array(
- 'name' => 'Footer Sidebar 3',
- 'id' => 'footer-sidebar-3',
- 'description' => 'Appears in the footer area',
- 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
- 'after_widget' => '</aside>',
- 'before_title' => '<h3 class="sidebarhd2">',
- 'after_title' => '</h3>',
- ) );
- }
- add_action( 'widgets_init', 'newtek_widgets_init' );
- function newtek_scripts_styles() {
- if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
- wp_enqueue_script( 'comment-reply' );
- wp_enqueue_style( 'newtek-style', get_stylesheet_uri(), array() );
- }
- add_action( 'wp_enqueue_scripts', 'newtek_scripts_styles' );
- // Register Theme Features
- function newtek_setup() {
- // Add theme support for Semantic Markup
- $markup = array( 'search-form', 'comment-form', 'comment-list', );
- add_theme_support( 'html5', $markup );
- add_theme_support( 'automatic-feed-links' );
- add_theme_support( 'custom-background' );
- $defaults = array(
- 'default-color' => '',
- 'default-image' => '',
- 'wp-head-callback' => '_custom_background_cb',
- 'admin-head-callback' => '',
- 'admin-preview-callback' => ''
- );
- add_theme_support( 'custom-background', $defaults );
- add_theme_support( 'post-thumbnails' );
- set_post_thumbnail_size( 640, 360, true );
- add_image_size( 'category-thumb', 640, 360, true );
- register_nav_menu( 'header-menu',__( 'Header Menu', 'newtek' ) );
- add_editor_style( 'editor-style.css' );
- }
- // Hook into the 'after_setup_theme' action
- add_action( 'after_setup_theme', 'newtek_setup' );
- function newtek_theme_customizer( $wp_customize ) {
- $wp_customize->add_section( 'newtek_logo_section' , array(
- 'title' => __( 'Logo', 'newtek' ),
- 'priority' => 30,
- 'description' => 'Upload a logo to replace the default site name. Suggested dimensions 300 width x 50 height.',
- ) );
- $wp_customize->add_setting( 'newtek_logo' );
- $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'newtek_logo', array(
- 'label' => __( 'Logo', 'newtek' ),
- 'section' => 'newtek_logo_section',
- 'settings' => 'newtek_logo',
- ) ) );
- }
- add_action('customize_register', 'newtek_theme_customizer');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement