__( 'Primary Navigation', 'twentyten' ), ) ); add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', ) ); $custom_header_support = array( 'width' => apply_filters( 'twentyten_header_image_width', 1200 ), 'height' => apply_filters( 'twentyten_header_image_height', 500 ), 'flex-height' => true, 'flex-width' => true, 'header-text' => false, 'admin-head-callback' => 'twentyten_admin_header_style', ); add_theme_support( 'custom-header', $custom_header_support ); // setup default header image if( false == get_theme_mod( 'header_image' ) || 'remove-header' == get_theme_mod( 'header_image' ) ) { set_theme_mod( 'header_image', get_stylesheet_directory_uri() . '/images/headers/bokeh-1.jpg' ); } add_action( 'wp_head', 'aphrosite_dynamic_css', 100 ); add_action( 'customize_register', 'aphrodite_customize_register' ); add_action( 'widgets_init', 'aphrodite_widgets_init' ); add_filter( 'body_class', 'aphrodite_layout_body_class' ); add_action( 'admin_menu', 'aphrodite_theme_preview' ); add_action( 'template_redirect', 'aphrodite_scripts' ); add_filter( 'wp_title', 'aphrodite_wp_title', 10, 2 ); // uncomment line below to display a credit link to the Aphrodite's download page // add_action( 'twentyten_credits', 'aphrodite_credits' ); } function aphrodite_customize_register( $customizer ) { $customizer->add_setting( 'logo' ); $customizer->add_control( new WP_Customize_Image_Control( $customizer, 'logo', array( 'label' => 'Logo', 'section' => 'title_tagline', ) ) ); $customizer->add_setting( 'logo_width' ); $customizer->add_control( 'logo_width', array( 'label' => 'Logo width (px)', 'section' => 'title_tagline', 'type' => 'text' ) ); $customizer->add_setting( 'logo_height' ); $customizer->add_control( 'logo_height', array( 'label' => 'Logo height (px)', 'section' => 'title_tagline', 'type' => 'text' ) ); $customizer->add_section( 'layouts', array( 'title' => 'Layouts', 'priority' => 40 ) ); $customizer->add_setting( 'layout', array( 'default' => 'sc' ) ); $customizer->add_control( 'layout', array( 'label' => 'Sidebars layout', 'section' => 'layouts', 'type' => 'select', 'choices' => array( 'cs' => 'Content on left', 'sc' => 'Content on right', 'ssc' => 'Two sidebars on the left', 'css' => 'Two sidebars on the right', 'scs' => 'Two sidebars' ) ) ); $customizer->add_setting( 'showcase_layout', array( 'default' => '3' ) ); $customizer->add_control( 'showcase_layout', array( 'label' => 'Showcase area layout', 'section' => 'layouts', 'type' => 'select', 'choices' => array( '1' => '1 Column', '2' => '2 Columns', '3' => '3 Columns', '4' => '4 Columns', ) ) ); $customizer->add_setting( 'footer_layout', array( 'default' => '4' ) ); $customizer->add_control( 'footer_layout', array( 'label' => 'Footer area layout', 'section' => 'layouts', 'type' => 'select', 'choices' => array( '1' => '1 Column', '2' => '2 Columns', '3' => '3 Columns', '4' => '4 Columns', ) ) ); $customizer->add_setting( 'fixed_wrapper_top_margin' ); $customizer->add_control( 'fixed_wrapper_top_margin', array( 'label' => 'Fixed margin for #wrapper (px)', 'section' => 'layouts', 'type' => 'text' ) ); $customizer->add_section( 'typography', array( 'title' => 'Typography', 'priority' => 50 ) ); $customizer->add_setting( 'header_font', array( 'default' => 'default' ) ); $customizer->add_control( 'header_font', array( 'label' => 'Headers', 'section' => 'typography', 'type' => 'select', 'choices' => aphrodite_get_google_fonts() ) ); $customizer->add_setting( 'link_color' ); $customizer->add_control( new WP_Customize_Color_Control( $customizer, 'link_color', array( 'label' => 'Links color', 'section' => 'colors' ) ) ); $customizer->add_setting( 'link_hover_color' ); $customizer->add_control( new WP_Customize_Color_Control( $customizer, 'link_hover_color', array( 'label' => 'Links hover color', 'section' => 'colors' ) ) ); $customizer->add_setting( 'site_title_color' ); $customizer->add_control( new WP_Customize_Color_Control( $customizer, 'site_title_color', array( 'label' => 'Site title color', 'section' => 'colors' ) ) ); $customizer->add_setting( 'menu_background' ); $customizer->add_control( new WP_Customize_Color_Control( $customizer, 'menu_background', array( 'label' => 'Menu background', 'section' => 'colors' ) ) ); } function aphrosite_dynamic_css() { if( false != get_theme_mod( 'fixed_wrapper_top_margin' ) ) { $header_image_height = get_theme_mod( 'fixed_wrapper_top_margin' ); } else { $header_image_height = get_custom_header()->height - 200; } $css = '#wrapper { margin-top: ' . $header_image_height . 'px; }'; $css .= '#header-image img { min-width: '. get_custom_header()->width .'px; }'; if( $menu_background = get_theme_mod( 'menu_background' ) ) $css .= "#access { background-color: {$menu_background}; }"; if( $logo = get_theme_mod( 'logo' ) ) $css .= "#site-title a { display: block; width: " . get_theme_mod( 'logo_width' ) . "px; height: ". get_theme_mod( 'logo_height' ) ."px; background: url('{$logo}') no-repeat; overflow: hidden; text-indent: -9999px;"; if( $link_color = get_theme_mod( 'link_color' ) ) $css .= "a:link { color: {$link_color}; }"; if( $link_hover_color = get_theme_mod( 'link_hover_color' ) ) $css .= "a:hover { color: {$link_hover_color}; }"; if( $site_title_color = get_theme_mod( 'site_title_color' ) ) $css .= "#site-title a, #site-description { color: {$site_title_color}; }"; $header_font = get_theme_mod( 'header_font' ); if( $header_font != '' && $header_font != 'default' ) { echo ''; $css .= ".entry-title { font-family: '{$header_font}', 'Helvetica', arial, serif; }"; } echo ''; } /** * list of Google fonts, taken from webfonts.php gizmo in Gantry Framework * @link http://gantry-framework.org/ */ function aphrodite_get_google_fonts() { $fonts = array( 'default' => 'Default' ); $google_fonts = array( "Aclonica", "Allan", "Allerta", "Allerta Stencil", "Amaranth", "Annie Use Your Telescope", "Anonymous Pro", "Anton", "Architects Daughter", "Arimo", "Artifika", "Arvo", "Asset", "Astloch", "Bangers", "Bentham", "Bevan", "Bigshot One", "Brawler", "Buda", "Cabin", "Cabin Sketch", "Calligraffitti", "Candal", "Cantarell", "Cardo", "Carter One", "Caudex", "Cedarville Cursive", "Cherry Cream Soda", "Chewy", "Coda", "Coming Soon", "Copse", "Corben", "Cousine", "Covered By Your Grace", "Crafty Girls", "Crimson Text", "Crushed", "Cuprum", "Damion", "Dancing Script", "Dawning of a New Day", "Didact Gothic", "Droid Sans", "Droid Sans Mono", "Droid Serif", "EB Garamond", "Expletus Sans", "Fontdiner Swanky", "Francois One", "Geo", "Goblin One", "Goudy Bookletter 1911", "Gravitas One", "Gruppo", "Hammersmith One", "Holtwood One SC", "Homemade Apple", "IM Fell", "Inconsolata", "Indie Flower", "Irish Grover", "Josefin Sans", "Josefin Slab", "Judson", "Jura", "Just Another Hand", "Just Me Again Down Here", "Kameron", "Kenia", "Kranky", "Kreon", "Kristi", "La Belle Aurore", "Lato", "League Script", "Lekton", "Limelight", "Lobster", "Lobster Two", "Lora", "Luckiest Guy", "Maiden Orange", "Mako", "Maven Pro", "Meddon", "MedievalSharp", "Megrim", "Merriweather", "Metrophobic", "Michroma", "Miltonian", "Molengo", "Monofett", "Mountains of Christmas", "Muli", "Neucha", "Neuton", "News Cycle", "Nixie One", "Nobile", "Nova", "Nunito", "OFL Sorts Mill Goudy TT", "Old Standard TT", "Open Sans", "Orbitron", "Oswald", "Over the Rainbow", "PT Sans", "PT Serif", "Pacifico", "Paytone One", "Permanent Marker", "Philosopher", "Play", "Playfair Display", "Podkova", "Puritan", "Quattrocento", "Quattrocento Sans", "Radley", "Raleway", "Redressed", "Reenie Beanie", "Rock Salt", "Rokkitt", "Ruslan Display", "Schoolbell", "Shadows Into Light", "Shanti", "Sigmar One", "Six Caps", "Slackey", "Smythe", "Sniglet", "Special Elite", "Sue Ellen Francisco", "Sunshiney", "Swanky and Moo Moo", "Syncopate", "Tangerine", "Tenor Sans", "Terminal Dosis Light", "The Girl Next Door", "Tinos", "Ubuntu", "Ultra", "UnifrakturCook", "UnifrakturMaguntia", "Unkempt", "VT323", "Varela", "Vibur", "Vollkorn", "Waiting for the Sunrise", "Wallpoet", "Walter Turncoat", "Wire One", "Yanone Kaffeesatz", "Zeyada" ); foreach( $google_fonts as $key => $value ) { $fonts[$value] = $value; } return $fonts; } function aphrodite_widgets_init() { register_sidebar( array( 'name' => __( 'First Showcase Widget Area', 'twentyten' ), 'id' => 'first-showcase-widget-area', 'description' => __( 'The first showcase widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Second Showcase Widget Area', 'twentyten' ), 'id' => 'second-showcase-widget-area', 'description' => __( 'The second showcase widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Third Showcase Widget Area', 'twentyten' ), 'id' => 'third-showcase-widget-area', 'description' => __( 'The third showcase widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'name' => __( 'Fourth Showcase Widget Area', 'twentyten' ), 'id' => 'fourth-showcase-widget-area', 'description' => __( 'The fourth showcase widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); } function aphrodite_layout_body_class( $classes ) { $classes[] = get_theme_mod( 'layout', 'sc' ); return $classes; } function aphrodite_theme_preview() { add_theme_page( 'Customize', 'Customize', 'edit_theme_options', 'customize.php' ); } function aphrodite_scripts() { if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } /** * Hybrid drop-downs. * @author Justin Tadlock * @license http://www.gnu.org/licenses/gpl.html */ wp_enqueue_script( 'drop-downs', get_stylesheet_directory_uri() . '/js/drop-downs.js', array( 'jquery' ), '1.4', true ); } function aphrodite_wp_title( $title, $sep ) { global $paged, $page; 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 = "$title $sep $site_description"; // Add a page number if necessary. if ( $paged >= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); return $title; } function aphrodite_credits() { echo 'Theme: Aphrodite'; }