Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'after_setup_theme', 'silverblue_add_editor_styles' );
- add_action( 'after_setup_theme', 'silverblue_setup' );
- function silverblue_setup()
- {
- load_theme_textdomain( 'silverblue', get_template_directory() . '/languages' );
- $args = array(
- 'flex-width' => true,
- 'width' => 950,
- 'flex-height' => true,
- 'height' => 348,
- 'default-image' => get_template_directory_uri() . '/images/silver-blue-and-gold-sky.jpg',
- 'uploads' => true,
- );
- add_theme_support( 'custom-header', $args );
- add_theme_support( 'automatic-feed-links' );
- add_theme_support( 'post-thumbnails' );
- add_theme_support( 'custom-background' );
- global $content_width;
- if ( ! isset( $content_width ) ) $content_width = 640;
- register_nav_menus(
- array( 'main' => __( 'Main Menu', 'silverblue' ) )
- );
- }
- function silverblue_add_editor_styles() {
- add_editor_style( 'custom-editor-style.css' );
- }
- add_action( 'wp_enqueue_scripts', 'silverblue_load_scripts' );
- function silverblue_load_scripts()
- {
- wp_enqueue_script( 'jquery' );
- }
- add_action( 'comment_form_before', 'silverblue_enqueue_comment_reply_script' );
- function silverblue_enqueue_comment_reply_script()
- {
- if ( get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }
- }
- add_filter( 'the_title', 'silverblue_title' );
- function silverblue_title( $title ) {
- if ( $title == '' ) {
- return '→';
- } else {
- return $title;
- }
- }
- function silverblue_customize_register( $wp_customize ) {
- $wp_customize->add_setting( 'dark_color' , array(
- 'default' => '#225a93',
- 'transport' => 'refresh',
- ) );
- $wp_customize->add_section( 'silverblue_dark_color' , array(
- 'title' => __( 'Darker Accent Color', 'silverblue' ),
- 'priority' => 40,
- ) );
- $wp_customize->add_control(
- new WP_Customize_Color_Control(
- $wp_customize,
- 'color',
- array(
- 'label' => __( 'Choose a color', 'silverblue' ),
- 'section' => 'silverblue_dark_color',
- 'settings' => 'dark_color',
- 'context' => 'normal'
- )
- ) );
- $wp_customize->add_setting( 'header_bgcolor' , array(
- 'default' => '#225a93',
- 'transport' => 'refresh',
- ) );
- $wp_customize->add_section( 'silverblue_header_bgcolor' , array(
- 'title' => __( 'Header and Footer Background Color', 'silverblue' ),
- 'priority' => 30,
- ) );
- $wp_customize->add_control(
- new WP_Customize_Color_Control(
- $wp_customize,
- 'color',
- array(
- 'label' => __( 'Choose a background color', 'silverblue' ),
- 'section' => 'silverblue_header_bgcolor',
- 'settings' => 'header_bgcolor',
- 'context' => 'normal'
- )
- )
- );
- }
- add_action( 'customize_register', 'silverblue_customize_register' );
- function silverblue_customize_css()
- {
- ?>
- <style type="text/css">
- #header, #footer { background-color: url(<?php echo get_theme_mod('header_bgcolor') ?>); }
- .entry-title, h3, .widget-title { color: <?php echo get_theme_mod('dark_color') ?>; } </style>
- <?php
- }
- add_action( 'wp_head', 'silverblue_customize_css');
- add_filter( 'wp_title', 'silverblue_filter_wp_title' );
- function silverblue_filter_wp_title( $title )
- {
- return $title . esc_attr( get_bloginfo( 'name' ) );
- }
- add_action( 'widgets_init', 'silverblue_widgets_init' );
- function silverblue_widgets_init()
- {
- register_sidebar( array (
- 'name' => __( 'sidebar', 'silverblue' ),
- 'id' => 'primary-widget-area',
- 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
- 'after_widget' => "</li>",
- 'before_title' => '<h3 class="widget-title">',
- 'after_title' => '</h3>',
- ) );
- register_sidebar( array (
- 'name' => __('Right Widget Area', 'silverblue'),
- 'id' => 'secondary-widget-area',
- 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
- 'after_widget' => "</li>",
- 'before_title' => '<h3 class="widget-title">',
- 'after_title' => '</h3>',
- ) );
- }
- function silverblue_custom_pings( $comment )
- {
- $GLOBALS['comment'] = $comment;
- ?>
- <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"><?php echo comment_author_link(); ?></li>
- <?php
- }
- add_filter( 'get_comments_number', 'silverblue_comments_number' );
- function silverblue_comments_number( $count )
- {
- if ( !is_admin() ) {
- global $id;
- $comments_by_type = &separate_comments( get_comments( 'status=approve&post_id=' . $id ) );
- return count( $comments_by_type['comment'] );
- } else {
- return $count;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement