Ticket #25144: 25144.1.diff
| File 25144.1.diff, 29.8 KB (added by , 12 years ago) |
|---|
-
wp-content/themes/twentyfourteen/functions.php
186 186 function twentyfourteen_font_url() { 187 187 $font_url = ''; 188 188 /* 189 * Translators: If there are characters in your language that are not supported 190 * by Lato, translate this to 'off'. Do not translate into your own language. 189 * Translators: If there are characters in your language that are not 190 * supported by Lato, translate this to 'off'. Do not translate into your 191 * own language. 191 192 */ 192 193 if ( 'off' !== _x( 'on', 'Lato font: on or off', 'twentyfourteen' ) ) 193 $font_url = add_query_arg( 'family', urlencode( 'Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' ), "//fonts.googleapis.com/css");194 $font_url = add_query_arg( 'family', urlencode( 'Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' ), '//fonts.googleapis.com/css' ); 194 195 195 196 return $font_url; 196 197 } … … 415 416 */ 416 417 function twentyfourteen_pre_get_posts( $query ) { 417 418 // Bail if not home, not a query, not main query. 418 if ( ! $query->is_ main_query() || is_admin() )419 if ( ! $query->is_home() || ! $query->is_main_query() ) 419 420 return; 420 421 421 // Only on the home page 422 if ( $query->is_home() ) { 423 $exclude_ids = array(); 424 425 $videos = twentyfourteen_get_recent( 'post-format-video' ); 426 $images = twentyfourteen_get_recent( 'post-format-image' ); 427 $galleries = twentyfourteen_get_recent( 'post-format-gallery' ); 428 $asides = twentyfourteen_get_recent( 'post-format-aside' ); 429 $links = twentyfourteen_get_recent( 'post-format-link' ); 430 $quotes = twentyfourteen_get_recent( 'post-format-quote' ); 431 432 foreach ( $videos->posts as $post ) 433 $exclude_ids[] = $post->ID; 434 435 foreach ( $images->posts as $post ) 436 $exclude_ids[] = $post->ID; 437 438 foreach ( $galleries->posts as $post ) 439 $exclude_ids[] = $post->ID; 440 441 foreach ( $asides->posts as $post ) 442 $exclude_ids[] = $post->ID; 443 444 foreach ( $links->posts as $post ) 445 $exclude_ids[] = $post->ID; 422 $exclude_ids = array(); 423 $post_formats = array( 424 twentyfourteen_get_recent( 'post-format-video' ), 425 twentyfourteen_get_recent( 'post-format-image' ), 426 twentyfourteen_get_recent( 'post-format-gallery' ), 427 twentyfourteen_get_recent( 'post-format-aside' ), 428 twentyfourteen_get_recent( 'post-format-link' ), 429 twentyfourteen_get_recent( 'post-format-quote' ), 430 ); 446 431 447 foreach ( $quotes->posts as $post ) 432 foreach ( $post_formats as $formatted_posts ) { 433 foreach ( $formatted_posts->posts as $post ) { 448 434 $exclude_ids[] = $post->ID; 449 450 $query->set( 'post__not_in', $exclude_ids ); 435 } 451 436 } 437 438 $query->set( 'post__not_in', $exclude_ids ); 452 439 } 453 440 add_action( 'pre_get_posts', 'twentyfourteen_pre_get_posts' ); 454 441 … … 470 457 if ( is_archive() || is_search() || is_home() ) 471 458 $classes[] = 'list-view'; 472 459 460 if ( get_header_image() ) 461 $classes[] = 'header-image'; 462 else 463 $classes[] = 'masthead-fixed'; 464 473 465 if ( ( ! is_front_page() && ! is_active_sidebar( 'sidebar-3' ) ) 474 466 || is_page_template( 'full-width-page.php' ) 475 467 || is_page_template( 'contributor-page.php' ) -
wp-content/themes/twentyfourteen/rtl.css
120 120 margin: 0 20px 0 0; 121 121 } 122 122 123 /* Mobile Navigations */124 .mobile-navigation ul ul li {125 margin-right: 15px;126 margin-left: auto;127 }128 129 123 130 124 /* =Content 131 125 ----------------------------------------------- */ … … 170 164 } 171 165 172 166 .tag-links a:before { 173 border-left: 10px solid # 8c8c8c;174 right: - 10px;167 border-left: 10px solid #767676; 168 right: -9px; 175 169 left: auto; 176 170 border-right: none; 177 171 } … … 222 216 margin-right: auto; 223 217 } 224 218 225 .post-navigation .nav-previous,226 .post-navigation .nav-next,219 .post-navigation [rel="prev"], 220 .post-navigation [rel="next"], 227 221 .image-navigation .previous-image, 228 222 .image-navigation .next-image { 229 223 text-align: right; … … 434 428 .comment-respond, 435 429 .comments-area article, 436 430 .comment-list .trackback, 437 .comment-list .pingback, 438 .post-navigation [rel="prev"], 439 .post-navigation [rel="next"] { 431 .comment-list .pingback { 440 432 padding-left: 9.12778904%; 441 433 padding-right: 9.12778904%; 442 434 } … … 497 489 .comment-respond, 498 490 .comments-area article, 499 491 .comment-list li.trackback, 500 .comment-list li.pingback, 501 .post-navigation [rel="prev"], 502 .post-navigation [rel="next"] { 492 .comment-list li.pingback { 503 493 padding-left: 12.39493534%; 504 494 padding-right: 17.06896551%; 505 495 } … … 619 609 .comment-respond, 620 610 .comments-area article, 621 611 .comment-list .trackback, 622 .comment-list .pingback, 623 .post-navigation [rel="prev"], 624 .post-navigation [rel="next"] { 612 .comment-list .pingback { 625 613 padding-left: 9.87001616%; 626 614 padding-right: 9.19765166%; 627 615 } … … 669 657 } 670 658 } 671 659 660 @media screen and (min-width: 1080px) { 661 .search-box-wrapper, 662 .featured-content { 663 padding-left: auto; 664 padding-right: 222px; 665 } 666 .site-content, 667 .full-width .site-content { 668 margin-left: auto; 669 margin-right: 222px; 670 } 671 .secondary-navigation ul ul { 672 left: auto; 673 right: 168px; 674 } 675 } 676 672 677 @media screen and (min-width: 1150px) { 673 678 .content-area .entry-header { 674 679 margin: -48px 12.5% 0 8.03571428%; … … 688 693 .comment-respond, 689 694 .comments-area article, 690 695 .comment-list .trackback, 691 .comment-list .pingback, 692 .post-navigation [rel="prev"], 693 .post-navigation [rel="next"] { 696 .comment-list .pingback { 694 697 padding-left: 12.44146986%; 695 698 padding-right: 16.77524429%; 696 699 } … … 748 751 } 749 752 } 750 753 754 @media screen and (min-width: 1218px) { 755 .content-area .entry-header, 756 .content-area .entry-content, 757 .content-area .entry-summary, 758 .content-area footer.entry-meta, 759 .archive-header, 760 .page-header, 761 .page-content, 762 .post-navigation, 763 .image-navigation, 764 .comments-area { 765 margin-left: 54px; 766 margin-right: auto; 767 } 768 .full-width .content-area .entry-header, 769 .full-width .content-area .entry-content, 770 .full-width .content-area .entry-summary, 771 .full-width .content-area footer.entry-meta, 772 .full-width .archive-header, 773 .full-width .page-header, 774 .full-width .page-content, 775 .full-width .post-navigation, 776 .full-width .image-navigation, 777 .full-width .comments-area { 778 margin-left: auto; 779 } 780 } 781 751 782 @media screen and (min-width: 1230px) { 752 783 .content-sidebar, 753 784 .post-formatted-posts { … … 770 801 .full-width .comment-list .pingback { 771 802 padding-left: 0; 772 803 } 773 } 774 No newline at end of file 804 } -
wp-content/themes/twentyfourteen/inc/custom-header.php
1 1 <?php 2 2 /** 3 * @todo: File description 4 * 3 5 * @package WordPress 4 6 * @subpackage Twenty_Fourteen 5 7 */ … … 7 9 /** 8 10 * Setup the WordPress core custom header feature. 9 11 * 10 * Use add_theme_support to register support for WordPress 3.4+11 * as well as provide backward compatibility for previous versions.12 * Use feature detection of wp_get_theme() which was introduced13 * in WordPress 3.4.14 *15 * @todo Rework this function to remove WordPress 3.4 support when WordPress 3.6 is released.16 *17 12 * @uses twentyfourteen_header_style() 18 13 * @uses twentyfourteen_admin_header_style() 19 14 * @uses twentyfourteen_admin_header_image() 20 15 * 21 * @package WordPress 22 * @subpackage Twenty_Fourteen 16 * @return void 23 17 */ 24 18 function twentyfourteen_custom_header_setup() { 25 19 add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array( … … 116 110 * 117 111 */ 118 112 function twentyfourteen_admin_header_image() { 119 $header_image = get_header_image();120 113 ?> 121 114 <div id="headimg"> 122 <?php if ( ! empty( $header_image) ) : ?>115 <?php if ( get_header_image() ) : ?> 123 116 <img src="<?php echo esc_url( $header_image ); ?>" alt=""> 124 117 <?php endif; ?> 125 118 <h1 class="displaying-header-text"><a id="name"<?php echo sprintf( ' style="color:#%s;"', get_header_textcolor() ); ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1> -
wp-content/themes/twentyfourteen/inc/customizer.php
23 23 $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'accent_color', array( 24 24 'label' => __( 'Accent Color', 'twentyfourteen' ), 25 25 'section' => 'colors', 26 'settings' => 'accent_color',27 26 ) ) ); 28 27 } 29 28 add_action( 'customize_register', 'twentyfourteen_customize_register' ); … … 45 44 function twentyfourteen_generate_accent_colors( $color ) { 46 45 $color = sanitize_hex_color( $color ); 47 46 48 set_theme_mod( 'accent_ lighter',twentyfourteen_adjust_color( $color, 14 ) );49 set_theme_mod( 'accent_ much_lighter', twentyfourteen_adjust_color( $color, 71 ) );47 set_theme_mod( 'accent_hover', twentyfourteen_adjust_color( $color, 14 ) ); 48 set_theme_mod( 'accent_active', twentyfourteen_adjust_color( $color, 71 ) ); 50 49 51 50 return $color; 52 51 } … … 64 63 */ 65 64 function twentyfourteen_adjust_color( $color, $steps ) { 66 65 // Convert shorthand to full hex. 67 if ( strlen( $color ) == 3 ) { 68 $color = str_repeat( substr( $color, 1, 1 ), 2 ) . str_repeat( substr( $color, 2, 1 ), 2 ) . str_repeat( substr( $color, 3, 1), 2 ); 69 } 66 if ( strlen( $color ) == 3 ) 67 $color = str_repeat( substr( $color, 1, 1 ), 2 ) . str_repeat( substr( $color, 2, 1 ), 2 ) . str_repeat( substr( $color, 3, 1 ), 2 ); 70 68 71 69 // Convert hex to rgb. 72 $rgb = array( hexdec( substr( $color, 1, 2 ) ), hexdec( substr( $color, 3, 2 ) ), hexdec( substr( $color, 5, 2 ) ) ); 70 $rgb = array( 71 hexdec( substr( $color, 1, 2 ) ), 72 hexdec( substr( $color, 3, 2 ) ), 73 hexdec( substr( $color, 5, 2 ) ), 74 ); 73 75 74 76 // Adjust color and switch back to hex. 75 77 $hex = '#'; 76 foreach ( $rgb as $ c) {77 $ c+= $steps;78 if ( $ c> 255 )79 $ c= 255;80 elseif ( $ c< 0 )81 $ c= 0;82 $hex .= str_pad( dechex( $ c ), 2, '0', STR_PAD_LEFT);78 foreach ( $rgb as $rgb_color ) { 79 $rgb_color += $steps; 80 if ( $rgb_color > 255 ) 81 $rgb_color = 255; 82 elseif ( $rgb_color < 0 ) 83 $rgb_color = 0; 84 $hex .= str_pad( dechex( $rgb_color ), 2, '0', STR_PAD_LEFT ); 83 85 } 84 86 85 87 return $hex; … … 89 91 * Outputs the css for the Theme Customizer options. 90 92 */ 91 93 function twentyfourteen_customizer_styles() { 92 $accent_color = get_theme_mod( 'accent_color' );94 $accent_color = get_theme_mod( 'accent_color', '#24890d' ); 93 95 94 96 // Don't do anything if the current color is the default. 95 97 if ( '#24890d' === $accent_color ) 96 98 return; 97 99 98 $accent_lighter = get_theme_mod( 'accent_lighter' ); 99 $accent_much_lighter = get_theme_mod( 'accent_much_lighter' ); 100 $accent_hover = get_theme_mod( 'accent_hover' ); 101 if ( ! $accent_hover ) { 102 $accent_hover = twentyfourteen_adjust_color( $accent_color, 14 ); 103 set_theme_mod( 'accent_hover', $accent_hover ); 104 } 105 106 $accent_active = get_theme_mod( 'accent_active' ); 107 if ( ! $accent_active ){ 108 $accent_active = twentyfourteen_adjust_color( $accent_color, 71 ); 109 set_theme_mod( 'accent_active', $accent_active ); 110 } 100 111 101 $css = ' <style type="text/css" id="twentyfourteen-accent-color">112 $css = ' 102 113 /* Custom accent color. */ 103 114 h1 a:hover, 104 115 h2 a:hover, … … 120 131 color: ' . $accent_color . '; 121 132 } 122 133 134 @media screen and (min-width: 770px) { 135 .primary-navigation ul ul a:hover { 136 color: ' . $accent_color . '; 137 } 138 } 139 123 140 button:hover, 124 141 html input[type="button"]:hover, 125 142 input[type="reset"]:hover, … … 158 175 159 176 .page-links a:hover, 160 177 .paging-navigation .page-numbers.current { 161 border-color: ' . $accent_color . ';178 border-color: ' . $accent_color . '; 162 179 } 163 180 164 181 /* Generated variant of custom accent color: slightly lighter. */ … … 178 195 .widget-area input[type="reset"]:active, 179 196 .widget-area input[type="submit"]:active, 180 197 .widget_calendar a:hover { 181 background-color: ' . $accent_ lighter . ';198 background-color: ' . $accent_hover . '; 182 199 } 183 200 184 201 /* Generated variant of custom accent color: much lighter. */ … … 190 207 .content-sidebar html input[type="button"]:active, 191 208 .content-sidebar input[type="reset"]:active, 192 209 .content-sidebar input[type="submit"]:active { 193 background-color: ' . $accent_ much_lighter. ';210 background-color: ' . $accent_active . '; 194 211 } 195 212 196 213 a:hover, … … 205 222 #featured-content .entry-title a:hover, 206 223 #featured-content .more-link, 207 224 .widget-area a:hover { 208 color: ' . $accent_much_lighter . '; 209 } 210 </style>'; 225 color: ' . $accent_active . '; 226 }'; 211 227 212 228 wp_add_inline_style( 'twentyfourteen-style', $css ); 213 229 } -
wp-content/themes/twentyfourteen/inc/template-tags.php
32 32 $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; 33 33 34 34 $links = paginate_links( array( 35 'base' => $pagenum_link,36 'format' => $format,37 'total' => $GLOBALS['wp_query']->max_num_pages,38 'current' => $paged,39 'mid_size' => 1,40 'add_args' => array_map( 'urlencode', $query_args ),35 'base' => $pagenum_link, 36 'format' => $format, 37 'total' => $GLOBALS['wp_query']->max_num_pages, 38 'current' => $paged, 39 'mid_size' => 1, 40 'add_args' => array_map( 'urlencode', $query_args ), 41 41 'prev_text' => __( '← Previous', 'twentyfourteen' ), 42 42 'next_text' => __( 'Next →', 'twentyfourteen' ), 43 43 ) ); -
wp-content/themes/twentyfourteen/header.php
8 8 * @subpackage Twenty_Fourteen 9 9 */ 10 10 ?><!DOCTYPE html> 11 <html <?php language_attributes(); ?> class="no-js">11 <html <?php language_attributes(); ?>> 12 12 <head> 13 13 <meta charset="<?php bloginfo( 'charset' ); ?>" /> 14 14 <meta name="viewport" content="width=device-width" /> … … 34 34 </div> 35 35 <?php endif; ?> 36 36 37 <header id="masthead" class="site-header " role="banner">37 <header id="masthead" class="site-header masthead-fixed" role="banner"> 38 38 <div class="header-main"> 39 39 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1> 40 40 … … 44 44 </div> 45 45 </div> 46 46 47 <nav role="navigation" class="site-navigation primary-navigation">48 <h1 class=" screen-reader-text"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></h1>49 < div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyfourteen' ); ?>"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a></div>50 <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>47 <nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> 48 <h1 class="menu-toggle"><?php _e( 'Primary Menu', 'twentyfourteen' ); ?></h1> 49 <a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyfourteen' ); ?>"><?php _e( 'Skip to content', 'twentyfourteen' ); ?></a> 50 <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> 51 51 </nav> 52 52 </div> 53 53 54 <div id="mobile-navigations" class="hide"></div>55 56 54 <div id="search-container" class="search-box-wrapper hide"> 57 55 <div class="search-box clear"> 58 56 <?php get_search_form(); ?> -
wp-content/themes/twentyfourteen/style.css
295 295 font-size: 12px; 296 296 font-weight: 700; 297 297 line-height: 1; 298 padding: 1 3px 33px 11px;298 padding: 12px 33px 10px; 299 299 text-transform: uppercase; 300 300 vertical-align: top; 301 301 } … … 468 468 } 469 469 470 470 /* Genericons */ 471 .menu-toggle:before, 471 472 .search-toggle:before, 472 473 .contributor-posts-link:before, 473 474 .widget_twentyfourteen_ephemera .widget-title:before { … … 541 542 width: 100%; 542 543 z-index: 3; 543 544 } 544 545 /* Fixed Header */546 .site-header.masthead-fixed {547 box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2);548 position: fixed;549 top: 0;550 }551 .admin-bar .site-header.masthead-fixed {552 top: 28px;553 }554 .admin-bar.mp6 .site-header.masthead-fixed {555 top: 32px;556 }557 545 #site-header { 558 546 position: relative; 559 547 z-index: 3; … … 578 566 .site-title a { 579 567 color: #fff; 580 568 } 581 #nav-toggle {569 .menu-toggle { 582 570 background-color: #000; 571 font-size: 0; 572 height: 16px; 573 margin: 0; 583 574 padding: 16px; 584 575 position: absolute; 585 576 top:0; 586 577 right: 0; 587 line-height: 1;588 578 } 589 #nav-toggle:before {579 .menu-toggle:before { 590 580 content: '\F419'; 591 581 color: #fff; 592 582 } 593 #nav-toggle:hover {583 .menu-toggle:hover { 594 584 cursor: pointer; 595 585 } 596 586 .search-toggle { … … 651 641 /* =Menu 652 642 ----------------------------------------------- */ 653 643 654 /* Primary Navigation */644 /* Primary Navigations */ 655 645 .primary-navigation { 656 display: none; 657 float: right; 658 font-size: 11px; 659 font-weight: 700; 660 line-height: 1.6363636363; 661 margin: 0 10px 0 -10px; 662 text-transform: uppercase; 663 } 664 .primary-navigation ul { 665 list-style: none; 666 margin: 0; 667 padding-left: 0; 668 } 669 .primary-navigation li { 646 background-color: #000; 670 647 -webkit-box-sizing: border-box; 671 648 -moz-box-sizing: border-box; 672 649 box-sizing: border-box; 673 display: inline-block; 674 height: 48px; 675 line-height: 48px; 676 position: relative; 650 font-size: 14px; 651 font-weight: 700; 652 margin: 1px auto 0; 653 max-width: 474px; 654 padding: 24px 10px 0; 655 text-transform: uppercase; 677 656 } 678 .primary-navigation a { 679 color: #fff; 680 display: inline-block; 681 padding: 0 10px; 682 text-decoration: none; 683 white-space: nowrap; 657 .primary-navigation.toggled-on { 658 padding-top: 72px; 684 659 } 685 .primary-navigation ul ul { 686 background-color: rgba(0, 0, 0, 0.9); 660 .primary-navigation .nav-menu { 687 661 display: none; 688 float: left;689 position: absolute;690 top: 48px;691 left: 0;692 z-index: 99999;693 662 } 694 .primary-navigation li li{663 .primary-navigation.toggled-on .nav-menu { 695 664 display: block; 696 height: auto;697 line-height: 1.6363636363;698 665 } 699 .primary-navigation ul ul ul{700 l eft: 100%;701 top: 0;666 .primary-navigation ul { 667 list-style: none; 668 margin: 0; 702 669 } 703 .primary-navigation ul ul a { 704 padding: 9px 12px; 705 width: 148px; 706 white-space: normal; 670 .primary-navigation li { 671 border-top: 1px solid rgba(255, 255, 255, 0.4); 707 672 } 708 .primary-navigation ul ul li { 673 .primary-navigation li li { 674 border-top: 1px solid rgba(255, 255, 255, 0.2); 709 675 } 710 .primary-navigation li:hover > a { 711 background-color: #2b2b2b; 712 color: #fff; 676 .primary-navigation ul ul li { 677 margin-left: 15px; 713 678 } 714 .primary-navigation ul li:hover > ul { 679 .primary-navigation a { 680 color: rgba(255, 255, 255, 1); 715 681 display: block; 682 padding: 7px 0 7px; 683 text-decoration: none; 716 684 } 717 .primary-navigation li.current_page_item > a, 718 .primary-navigation li.current-menu-item > a { 719 color: #5FF23D; 685 .primary-navigation a:hover { 686 color: rgba(255, 255, 255, 0.7); 720 687 } 721 688 722 689 /* Secondary Navigation */ … … 754 721 color: #5FF23D; 755 722 } 756 723 757 /* Mobile Navigations */758 #mobile-navigations {759 margin: 1px auto 0;760 max-width: 474px;761 }762 .mobile-navigation {763 background-color: #000;764 -webkit-box-sizing: border-box;765 -moz-box-sizing: border-box;766 box-sizing: border-box;767 font-size: 14px;768 font-weight: 700;769 padding: 24px 10px 0;770 text-transform: uppercase;771 }772 .mobile-navigation ul {773 list-style: none;774 margin: 0;775 }776 .mobile-navigation li {777 border-top: 1px solid rgba(255, 255, 255, 0.4);778 }779 .mobile-navigation li li {780 border-top: 1px solid rgba(255, 255, 255, 0.2);781 }782 .mobile-navigation ul ul li {783 margin-left: 15px;784 }785 .mobile-navigation a {786 color: rgba(255, 255, 255, 1);787 display: block;788 padding: 7px 0 7px;789 text-decoration: none;790 }791 .mobile-navigation a:hover {792 color: rgba(255, 255, 255, 0.7);793 }794 795 724 796 725 /* =Content 797 726 ----------------------------------------------- */ … … 1099 1028 font-weight: 700; 1100 1029 line-height: 1.2727272727; 1101 1030 margin: 0 4px 4px 10px; 1102 padding: 3px 7px;1031 padding: 4px 7px 2px; 1103 1032 position: relative; 1104 1033 text-transform: uppercase; 1105 1034 } … … 1927 1856 .widget_calendar a:hover { 1928 1857 background-color: #35921f; 1929 1858 } 1859 #prev a, 1860 #next a { 1861 background-color: transparent; 1862 } 1863 1930 1864 .widget-area .widget_calendar a:hover { 1931 1865 color: #fff; /* Override custom accent color with more specific selector. */ 1932 1866 } … … 2384 2318 .header-main { 2385 2319 margin-right: 0; 2386 2320 } 2321 2322 /* Fixed Header */ 2323 .masthead-fixed .site-header { 2324 box-shadow: 0 1px 8px rgba(0, 0, 0, 0.2); 2325 position: fixed; 2326 top: 0; 2327 } 2328 .admin-bar.masthead-fixed .site-header { 2329 top: 28px; 2330 } 2331 .admin-bar.mp6.masthead-fixed .site-header { 2332 top: 32px; 2333 } 2334 .masthead-fixed .site-main { 2335 margin-top: 48px; 2336 } 2337 2338 /* Primary Navigation */ 2387 2339 .primary-navigation { 2340 float: right; 2341 font-size: 11px; 2342 font-weight: 700; 2343 line-height: 1.6363636363; 2344 margin: 0 10px 0 -10px; 2345 padding: 0; 2346 text-transform: uppercase; 2347 } 2348 .primary-navigation .menu-toggle { 2349 display: none; 2350 padding: 0; 2351 } 2352 .primary-navigation .nav-menu { 2388 2353 display: block; 2389 2354 } 2355 .primary-navigation.toggled-on { 2356 padding: 0; 2357 } 2358 .primary-navigation li { 2359 border: 0; 2360 -webkit-box-sizing: border-box; 2361 -moz-box-sizing: border-box; 2362 box-sizing: border-box; 2363 display: inline-block; 2364 height: 48px; 2365 line-height: 48px; 2366 position: relative; 2367 } 2368 .primary-navigation a { 2369 display: inline-block; 2370 padding: 0 10px; 2371 white-space: nowrap; 2372 } 2373 .primary-navigation ul ul { 2374 background-color: rgba(0, 0, 0, 0.9); 2375 display: none; 2376 float: left; 2377 position: absolute; 2378 top: 48px; 2379 left: 0; 2380 z-index: 99999; 2381 } 2382 .primary-navigation li li { 2383 border: 0; 2384 display: block; 2385 height: auto; 2386 line-height: 1.6363636363; 2387 } 2388 .primary-navigation ul ul ul { 2389 left: 100%; 2390 top: 0; 2391 } 2392 .primary-navigation ul ul a { 2393 padding: 9px 12px; 2394 width: 148px; 2395 white-space: normal; 2396 } 2397 .primary-navigation ul ul li { 2398 margin: 0; 2399 } 2400 .primary-navigation li:hover > a { 2401 background-color: #2b2b2b; 2402 color: #fff; 2403 } 2404 .primary-navigation li li:hover > a { 2405 background-color: #000; 2406 } 2407 .primary-navigation ul ul a:hover { 2408 color: #24890d; 2409 } 2410 .primary-navigation ul li:hover > ul { 2411 display: block; 2412 } 2413 .primary-navigation li.current_page_item > a, 2414 .primary-navigation li.current-menu-item > a { 2415 color: #5FF23D; 2416 } 2390 2417 } 2391 2418 2392 2419 @media screen and (min-width: 810px) { -
wp-content/themes/twentyfourteen/js/customizer.js
16 16 $( '.site-description' ).text( to ); 17 17 } ); 18 18 } ); 19 } )( jQuery ); 20 No newline at end of file 19 } )( jQuery ); -
wp-content/themes/twentyfourteen/js/theme.js
1 /** 2 * Functionality specific to Twenty Fourteen. 3 * 4 * Provides helper functions to enhance the theme experience. 5 */ 6 1 7 ( function( $ ) { 8 var body = $( 'body' ), 9 _window = $( window ); 2 10 3 $( document ).ready( function() { 11 /** 12 * Enables menu toggle for small screens. 13 */ 14 ( function() { 15 var nav = $( '#primary-navigation' ), button, menu; 16 if ( ! nav ) 17 return; 4 18 5 var $primaryNaviClone, 6 $secondaryNaviClone, 7 $masthead = $( '#masthead' ), 8 $secondaryTop = $( '#secondary-top' ), 9 $mobileNavigations = $( '#mobile-navigations'), 10 $searchBoxWrapper = $( 'div.search-box-wrapper' ), 11 $searchToggle = $( 'div.search-toggle' ), 12 timeout = false; 19 button = nav.find( '.menu-toggle' ); 20 if ( ! button ) 21 return; 13 22 14 // Toggle function. 15 function menuToggle() { 16 $( 'span#nav-toggle' ).toggleClass( 'active' ); 17 $masthead.find( '#mobile-navigations' ).toggleClass( 'hide' ); 23 // Hide button if menu is missing or empty. 24 menu = nav.find( '.nav-menu' ); 25 if ( ! menu || ! menu.children().length ) { 26 button.hide(); 27 return; 18 28 } 19 29 20 // Click event for toggle the search 21 $searchToggle.click( function() { 22 $( this ).toggleClass( 'active' ); 23 $searchBoxWrapper.toggleClass( 'hide' ); 24 25 if ( $( this ).hasClass( 'active' ) ) 26 $searchBoxWrapper.find( '.search-field' ).focus(); 30 $( '.menu-toggle' ).on( 'click.twentyfourteen', function() { 31 nav.toggleClass( 'toggled-on' ); 27 32 } ); 28 29 // DOM manipulations for mobile header 30 function mobileHeader() { 31 // Check if the toggler exists. If not add it. 32 if ( ! $( '#nav-toggle' ).length ) 33 $( '<span id="nav-toggle" class="genericon" />' ).appendTo( $masthead ); 34 35 // Clone and detach the primary navigation for use later 36 $primaryNaviClone = $masthead.find( 'nav.primary-navigation' ).detach(); 37 38 // Clone and detach the secondary navigation for use later 39 $secondaryNaviClone = $secondaryTop.find( 'nav.secondary-navigation' ).detach(); 40 41 // Prepend the primary navigation clone to #mobile-navigations and remove the class and add an id 42 $primaryNaviClone.prependTo( $mobileNavigations ).removeClass( 'primary-navigation' ).addClass( 'mobile-navigation' ).attr( 'id', 'primary-mobile-navigation' ); 43 44 // Append the secondary navigation clone to #mobile-navigations and remove the class and add an id 45 $secondaryNaviClone.appendTo( $mobileNavigations ).removeClass( 'secondary-navigation' ).addClass( 'mobile-navigation' ).attr( 'id', 'secondary-mobile-navigation' ); 46 47 // Remove the click event first and bind it after to make sure it's invoked once. 48 $( 'span#nav-toggle' ).off( 'click', menuToggle ).click( menuToggle ); 49 }; 50 51 // DOM manupilations for desktop header 52 function normalHeader() { 53 // Check if the toggler exists. If it does remove it. 54 if ( $( 'span#nav-toggle').length ) 55 $( 'span#nav-toggle' ).remove(); 56 57 // Clone and detach the primary mobile navigation for use later 58 $primaryNaviClone = $mobileNavigations.find( '#primary-mobile-navigation' ).detach(); 33 } )(); 59 34 60 // Clone and detach the secondary mobile navigation for use later 61 $secondaryNaviClone = $mobileNavigations.find( '#secondary-mobile-navigation' ).detach(); 35 $( function() { 36 /** 37 * Search toggle. 38 */ 39 $( '.search-toggle' ).on( 'click.twentyfourteen', function() { 40 var that = $( this ), 41 wrapper = $( '.search-box-wrapper' ); 62 42 63 // Append the secondary navigation clone to #mobile-navigations and remove the class and add an id64 $primaryNaviClone.appendTo( '.header-main' ).removeClass( 'mobile-navigation' ).removeAttr( 'id' ).addClass( 'primary-navigation' );43 that.toggleClass( 'active' ); 44 wrapper.toggleClass( 'hide' ); 65 45 66 // Append the secondary navigation clone to #mobile-navigations and remove the class and add an id 67 $secondaryNaviClone.appendTo( $secondaryTop ).removeClass( 'mobile-navigation' ).removeAttr( 'id' ).addClass( 'secondary-navigation' ); 68 }; 69 70 // Check viewport width when user resizes the browser window. 71 $( window ).resize( function() { 72 if ( false !== timeout ) 73 clearTimeout( timeout ); 74 75 timeout = setTimeout( function() { 76 if ( $( window ).width() < 770 ) { 77 mobileHeader(); 78 } else { 79 normalHeader(); 80 } 81 }, 100 ); 82 83 } ).resize(); 84 85 // Sticky header. 86 var $mastheadOffset = -1, 87 $toolbarOffset = $( 'body' ).is( '.admin-bar' ) ? 32 : 0, 88 $maindiv = $( '#main' ); 89 90 $( window ).on( 'scroll', false, function() { 91 if ( $mastheadOffset < 0 ) 92 $mastheadOffset = $masthead.offset().top - $toolbarOffset; 93 94 if ( ( window.scrollY > $mastheadOffset ) && ( $( window ).width() > 769 ) ) { 95 $masthead.addClass( 'masthead-fixed' ); 96 $maindiv.css( { 97 marginTop: $masthead.height() 98 } ); 99 } else { 100 $masthead.removeClass( 'masthead-fixed' ); 101 $maindiv.css( { 102 marginTop: 0 103 } ); 104 } 46 if ( that.is( '.active' ) ) 47 wrapper.find( '.search-field' ).focus(); 105 48 } ); 106 49 107 // Arranges footer widgets vertically. 108 if ( $.isFunction( $.fn.masonry ) ) { 109 110 $( '#footer-sidebar' ).masonry( { 111 itemSelector: '.widget', 112 columnWidth: 225, 113 gutterWidth: 27, 114 isRTL: $( 'body' ).is( '.rtl' ) 50 /** 51 * Fixed navbar. 52 */ 53 if ( body.is( '.header-image' ) && _window.width() > 769 ) { 54 var toolbarOffset = body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0, 55 mastheadOffset = $( '#masthead' ).offset().top - toolbarOffset; 56 57 _window.on( 'scroll.twentyfourteen', false, function() { 58 if ( window.scrollY > mastheadOffset ) 59 body.addClass( 'masthead-fixed' ); 60 else 61 body.removeClass( 'masthead-fixed' ); 115 62 } ); 116 63 } 117 118 64 } ); 119 65 120 } )( jQuery ); 121 No newline at end of file 66 /** 67 * Makes "skip to content" link work correctly in IE9 and Chrome for better 68 * accessibility. 69 * 70 * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ 71 */ 72 _window.on( 'hashchange.twentyfourteen', function() { 73 var element = document.getElementById( location.hash.substring( 1 ) ); 74 75 if ( element ) { 76 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) 77 element.tabIndex = -1; 78 79 element.focus(); 80 } 81 } ); 82 83 /** 84 * Arranges footer widgets vertically. 85 */ 86 if ( $.isFunction( $.fn.masonry ) ) { 87 $( '#footer-sidebar' ).masonry( { 88 itemSelector: '.widget', 89 columnWidth: 225, 90 gutterWidth: 27, 91 isRTL: body.is( '.rtl' ) 92 } ); 93 } 94 } )( jQuery );