__( 'Primary Navigation', 'twentyten' ), ) ); add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', ) ); $custom_header_support = array( 'default-image' => '%s/images/headers/path.jpg', '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 ); 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' ); } 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', 'section' => 'title_tagline', 'type' => 'text' ) ); $customizer->add_setting( 'logo_height' ); $customizer->add_control( 'logo_height', array( 'label' => 'Logo height', 'section' => 'title_tagline', 'type' => 'text' ) ); $customizer->add_section( 'layouts', array( 'title' => 'Layouts', 'priority' => 40 ) ); $customizer->add_setting( 'layout', array( 'default' => 'cs' ) ); $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_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' ) ) ); } function aphrosite_dynamic_css() { $header_image_height = get_custom_header()->height - 200; $css = '#wrapper { margin-top: ' . $header_image_height . 'px; }'; 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( $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', 'cs' ); return $classes; }