Changeset 26034
- Timestamp:
- 11/07/2013 05:28:56 PM (13 years ago)
- Location:
- trunk/src/wp-content/themes/twentyfourteen
- Files:
-
- 2 edited
-
inc/template-tags.php (modified) (3 diffs)
-
style.css (modified) (28 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php
r26026 r26034 166 166 */ 167 167 function twentyfourteen_post_thumbnail() { 168 if ( post_password_required() )168 if ( post_password_required() || ! has_post_thumbnail() ) 169 169 return; 170 170 … … 173 173 174 174 <div class="post-thumbnail"> 175 <?php176 if ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() )177 the_post_thumbnail( 'post-thumbnail' );178 else179 the_post_thumbnail( 'post-thumbnail-full-width' );180 ?>175 <?php 176 if ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() ) 177 the_post_thumbnail( 'post-thumbnail' ); 178 else 179 the_post_thumbnail( 'post-thumbnail-full-width' ); 180 ?> 181 181 </div> 182 182 … … 184 184 185 185 <a class="post-thumbnail" href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>"> 186 <?php if ( has_post_thumbnail() && ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() ) ) : 187 the_post_thumbnail( 'post-thumbnail' ); 188 elseif ( has_post_thumbnail() ) : 189 the_post_thumbnail( 'post-thumbnail-full-width' ); 190 else : ?> 191 <p class="screen-reader-text"><?php _e( 'No featured image.', 'twentyfourteen' ); ?></p> 192 <?php endif; ?> 186 <?php 187 if ( is_active_sidebar( 'sidebar-2' ) || wp_is_mobile() ) 188 the_post_thumbnail( 'post-thumbnail' ); 189 else 190 the_post_thumbnail( 'post-thumbnail-full-width' ); 191 ?> 193 192 </a> 194 193 -
trunk/src/wp-content/themes/twentyfourteen/style.css
r26023 r26034 999 999 1000 1000 .hentry { 1001 margin-bottom: 36px;1001 margin-bottom: 48px; 1002 1002 max-width: 672px; 1003 1003 } … … 1012 1012 } 1013 1013 1014 .page-content { 1015 margin-bottom: 48px; 1016 } 1017 1018 .hentry > :last-child { 1019 margin-bottom: 0 1020 } 1021 1014 1022 1015 1023 /** … … 1018 1026 */ 1019 1027 1020 .post-thumbnail { 1021 background: #767676 url(images/pattern-light.svg) repeat fixed; 1022 display: none; 1023 height: auto; 1024 margin: 0; 1025 min-height: 192px; 1028 .post-thumbnail { 1029 background: #b2b2b2 url(images/pattern-light.svg) repeat fixed; 1030 display: block; 1026 1031 position: relative; 1027 1032 width: 100%; … … 1030 1035 1031 1036 a.post-thumbnail:hover { 1032 background-color: #9 19191;1033 } 1034 1035 . post-thumbnail img {1037 background-color: #999; 1038 } 1039 1040 .full-width .post-thumbnail img { 1036 1041 display: block; 1037 1042 margin: 0 auto; 1038 }1039 1040 .has-post-thumbnail .post-thumbnail,1041 .format-standard .post-thumbnail {1042 display: block;1043 1043 } 1044 1044 … … 1076 1076 } 1077 1077 1078 .site-content .has-post-thumbnail .entry-header, 1079 .site-content .format-standard .entry-header { 1078 .site-content .has-post-thumbnail .entry-header { 1080 1079 padding-top: 24px; 1081 }1082 1083 .site-content .format-standard.post-password-required .entry-header {1084 padding-top: 0;1085 1080 } 1086 1081 … … 1145 1140 1146 1141 .site-content footer.entry-meta:empty { 1147 margin-top: 0; 1148 margin-bottom: 0; 1142 margin: 0; 1149 1143 } 1150 1144 … … 1160 1154 font-weight: 700; 1161 1155 line-height: 1.2727272727; 1162 margin: 0 4px 4px 10px;1156 margin: 2px 4px 2px 10px; 1163 1157 padding: 3px 7px; 1164 1158 position: relative; … … 1321 1315 font-weight: 900; 1322 1316 line-height: 2; 1323 margin -bottom: 24px;1317 margin: 24px 0; 1324 1318 text-transform: uppercase; 1325 1319 } … … 1579 1573 .paging-navigation { 1580 1574 border-top: 5px solid #000; 1581 margin: 36px 0;1575 margin: 48px 0; 1582 1576 } 1583 1577 … … 1641 1635 .archive-header, 1642 1636 .page-header { 1643 margin: 0 auto 12px;1637 margin: 24px auto; 1644 1638 max-width: 474px; 1645 1639 } … … 1657 1651 font-size: 14px; 1658 1652 line-height: 1.2857142857; 1653 } 1654 1655 .taxonomy-description p { 1659 1656 margin-bottom: 18px; 1657 } 1658 1659 .taxonomy-description p:last-child { 1660 margin-bottom: 0; 1660 1661 } 1661 1662 … … 1746 1747 */ 1747 1748 1748 .singular .hentry.format-standard,1749 1749 .singular .hentry.has-post-thumbnail { 1750 1750 margin-top: -24px; 1751 }1752 1753 .singular .hentry.format-standard.post-password-required {1754 margin-top: 01755 1751 } 1756 1752 … … 2698 2694 .featured-content .post-thumbnail { 2699 2695 display: block; 2700 min-height: 0;2701 2696 position: relative; 2702 2697 padding-top: 55.357142857%; … … 2869 2864 .list-view .site-content .post-thumbnail { 2870 2865 background: none; 2871 min-height: 0;2872 2866 width: auto; 2873 2867 z-index: 2; … … 2928 2922 .page-header { 2929 2923 border-bottom: 1px solid rgba(0, 0, 0, 0.1); 2930 padding-top: 12px; 2924 margin: 24px auto 0; 2925 padding-bottom: 24px; 2931 2926 } 2932 2927 2933 2928 .error404 .page-header { 2934 2929 border-bottom: 0; 2930 margin: 0 auto 24px; 2935 2931 padding: 0 10px; 2936 2932 } … … 3047 3043 } 3048 3044 3049 .list-view .site-content .has-post-thumbnail .post-thumbnail,3050 .list-view .site-content .format-standard .post-thumbnail {3051 margin-top: -49px;3052 }3053 3054 3045 .list-view .site-content .hentry { 3055 3046 border-top: 1px solid rgba(0, 0, 0, 0.1); 3056 padding-top: 48px; 3047 padding-top: 60px; 3048 } 3049 3050 .list-view .site-content .hentry:first-child, 3051 .list-view .site-content .hentry:first-of-type, 3052 .list-view .site-content .hentry.has-post-thumbnail { 3053 border-top: 0; 3054 padding-top: 0; 3057 3055 } 3058 3056 3059 3057 .archive-header, 3060 3058 .page-header { 3059 margin: 0 auto 60px; 3060 padding: 0 10px; 3061 } 3062 3063 .error404 .page-header { 3061 3064 margin-bottom: 24px; 3062 padding: 0 10px; 3065 } 3066 3067 .featured-content { 3068 margin-bottom: 48px; 3063 3069 } 3064 3070 } … … 3070 3076 } 3071 3077 3072 .site-content .has-post-thumbnail .entry-header, 3073 .site-content .format-standard .entry-header { 3078 .site-content .has-post-thumbnail .entry-header { 3074 3079 margin-top: -48px; 3075 }3076 3077 .site-content .format-standard.post-password-required .entry-header {3078 margin-top: 0;3079 3080 } 3080 3081 } … … 3095 3096 .content-area { 3096 3097 float: left; 3097 padding-top: 36px;3098 padding-top: 48px; 3098 3099 width: 100%; 3099 3100 } … … 3103 3104 } 3104 3105 3105 .site-content .has-post-thumbnail .entry-header, 3106 .site-content .format-standard .entry-header { 3106 .site-content .has-post-thumbnail .entry-header { 3107 3107 margin-top: 0; 3108 3108 } … … 3121 3121 } 3122 3122 3123 .singular .hentry.format-standard, 3124 .singular .hentry.has-post-thumbnail, 3125 .singular .hentry.format-standard.post-password-required { 3123 .singular .hentry.has-post-thumbnail { 3126 3124 margin-top: 0 3127 3125 } … … 3131 3129 } 3132 3130 3133 .full-width .site-content .has-post-thumbnail .entry-header, 3134 .full-width .site-content .format-standard .entry-header { 3131 .full-width .site-content .has-post-thumbnail .entry-header { 3135 3132 margin-top: -48px; 3136 3133 } 3137 3134 3138 .full-width .site-content .format-standard.post-password-required .entry-header {3139 margin-top: 03140 }3141 3142 .full-width.singular .hentry.format-standard,3143 3135 .full-width.singular .hentry.has-post-thumbnail { 3144 margin-top: -36px; 3145 } 3146 3147 .full-width.singular .hentry.format-standard.post-password-required { 3148 margin-top: 0 3136 margin-top: -48px; 3149 3137 } 3150 3138 … … 3158 3146 float: right; 3159 3147 margin-left: -33.33333333%; 3160 padding: 36px 30px 24px;3148 padding: 48px 30px 24px; 3161 3149 width: 33.33333333%; 3150 } 3151 3152 .featured-content { 3153 margin-bottom: 24px; 3162 3154 } 3163 3155 … … 3407 3399 } 3408 3400 3409 .site-content .has-post-thumbnail .entry-header, 3410 .site-content .format-standard .entry-header { 3401 .site-content .has-post-thumbnail .entry-header { 3411 3402 margin-top: -48px; 3412 }3413 3414 .site-content .format-standard.post-password-required .entry-header {3415 margin-top: 0;3416 3403 } 3417 3404 … … 3440 3427 } 3441 3428 3442 .full-width.singular .hentry.format-standard,3443 3429 .full-width.singular .hentry.has-post-thumbnail { 3444 3430 margin-top: -72px; 3445 3431 } 3446 3432 3447 .full-width.singular .hentry.format-standard.post-password-required {3448 margin-top: 03449 }3450 3451 3433 .featured-content { 3452 margin-bottom: -24px;3434 margin-bottom: 0 3453 3435 } 3454 3436 } … … 3472 3454 } 3473 3455 3474 .site-content .has-post-thumbnail .entry-header, 3475 .site-content .format-standard .entry-header { 3456 .site-content .has-post-thumbnail .entry-header { 3476 3457 margin-top: 0; 3477 3458 } … … 3728 3709 3729 3710 @media screen and (min-width: 1040px) { 3730 .site-content .has-post-thumbnail .entry-header, 3731 .site-content .format-standard .entry-header { 3711 .site-content .has-post-thumbnail .entry-header { 3732 3712 margin-top: -48px; 3733 }3734 3735 .site-content .format-standard.post-password-required .entry-header {3736 margin-top: 0;3737 3713 } 3738 3714 … … 3989 3965 } 3990 3966 3991 .post-thumbnail {3992 min-height: 0;3993 }3994 3995 3967 .post-thumbnail img { 3996 3968 margin: 0 10px 24px; 3997 3969 } 3998 3970 3999 .site-content .has-post-thumbnail .entry-header, 4000 .site-content .format-standard .entry-header { 3971 .site-content .has-post-thumbnail .entry-header { 4001 3972 padding-top: 0; 4002 3973 } … … 4010 3981 } 4011 3982 4012 .singular .hentry.format-standard,4013 3983 .singular .hentry.has-post-thumbnail { 4014 3984 margin-top: 0;
Note: See TracChangeset
for help on using the changeset viewer.