'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' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } /** * Comment Reply Script. * * Hooks into the 'wp_enqueue_scripts' filter. */ function retro_fitted_reply_script() { _deprecated_function( __FUNCTION__, '0.2', 'retro_fitted_scripts()' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } /** * Callback for wp_list_comments(). */ function retro_fitted_comments_callback( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; $GLOBALS['comment_depth'] = $depth; ?>
  • >
    ', esc_url( get_comment_link( $comment->comment_ID ) ), esc_attr__( 'Permalink to this comment', 'retro-fitted' ), esc_attr( get_comment_time( 'c' ) ), /* translators: 1: date, 2: time */ sprintf( __( '%1$s at %2$s', 'retro-fitted' ), get_comment_date(), get_comment_time() ) ); edit_comment_link( __( 'Edit', 'retro-fitted' ), __( ' | ', 'retro-fitted' ) ); comment_reply_link( array_merge( $args, array( 'before' => __( ' | ', 'retro-fitted' ), 'depth' => $depth, 'max_depth' => $args['max_depth'], ) ) ); ?>
    comment_approved ) : ?>

    comment_ID ); ?>
    tag based on what is being viewed. * * @since Retro-fitted 0.2 */ function retro_fitted_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'retro-fitted' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'retro_fitted_wp_title', 10, 2 );