'retro_fitted_background', ) ); add_theme_support( 'custom-header', apply_filters( 'retro_fitted_custom_header_args', array( 'default-image' => '', 'default-text-color' => '04648d', 'width' => 1020, 'height' => 150, 'wp-head-callback' => 'retro_fitted_header_style', 'admin-head-callback' => 'retro_fitted_admin_header_style', 'admin-preview-callback' => 'retro_fitted_admin_header_div', ) ) ); add_theme_support( 'automatic-feed-links' ); register_nav_menus( array( 'primary' => 'Primary' ) ); add_theme_support( 'print-style' ); load_theme_textdomain( 'retro-fitted', get_template_directory() . '/languages' ); } } add_action( 'after_setup_theme', 'retro_fitted_setup' ); /** * Enqueue scripts and styles */ function retro_fitted_scripts() { wp_enqueue_style( 'retro_fitted', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'retro_fitted_scripts' ); /** * Toggle layout in select templates. * * Hooks into the "body_class" filter. */ function retro_fitted_body_class( $classes ) { $layout = 'single-column'; if ( is_active_sidebar( 'sidebar-1' ) && ! wp_attachment_is_image() && ! is_404() ) $layout = 'content-sidebar'; $classes[] = $layout; return $classes; } add_filter( 'body_class', 'retro_fitted_body_class' ); /** * All entries should contain floats. * * Hooks into the "post_class" filter. */ function retro_fitted_post_class( $classes ) { $classes[] = 'contain'; return $classes; } add_filter( 'post_class', 'retro_fitted_post_class' ); /** * Adjust $content width if a sidebar is present in select templates. * * 404.php and image.php will never have a sidebar. * * Hooks into the "template_redirect" action. */ function retro_fitted_content_width() { if ( is_404() || wp_attachment_is_image() ) return; if ( is_active_sidebar( 'sidebar-1' ) ) { global $content_width; $content_width = 620; } } add_action( 'template_redirect', 'retro_fitted_content_width' ); /** * Custom background CSS for public-facing templates. */ function retro_fitted_background() { $background = get_background_image(); $color = get_background_color(); if ( ! $background && ! $color ) return; $style = $color ? "background-color: #$color;" : ''; if ( $background ) { $image = " background-image: url('$background');"; $repeat = get_theme_mod( 'background_repeat', 'repeat' ); if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) $repeat = 'repeat'; $repeat = " background-repeat: $repeat;"; $position = get_theme_mod( 'background_position_x', 'left' ); if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) $position = 'left'; $position = " background-position: top $position;"; $attachment = get_theme_mod( 'background_attachment', 'scroll' ); if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) $attachment = 'scroll'; $attachment = " background-attachment: $attachment;"; $style .= $image . $repeat . $position . $attachment; } else { $style .= " background-image: none;"; } ?> Header screen. */ function retro_fitted_admin_header_div() { ?>
Header screen. */ function retro_fitted_admin_header_style() { ?> __( 'Sidebar', 'retro-fitted' ), 'before_widget' => ' ', 'before_title' => '