Changeset 17761
- Timestamp:
- 04/29/2011 12:19:02 AM (15 years ago)
- Location:
- trunk/wp-content/themes/twentyeleven
- Files:
-
- 1 added
- 3 edited
-
functions.php (modified) (1 diff)
-
js/showcase.js (added)
-
showcase.php (modified) (8 diffs)
-
style.css (modified) (45 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyeleven/functions.php
r17739 r17761 129 129 130 130 // Add Twenty Eleven's custom image sizes 131 add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, 500, true ); // Used for large feature images132 add_image_size( 'small-feature', 500, 500 ); // Used for featured posts if a large-feature doesn't exist131 add_image_size( 'large-feature', HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Used for large feature images 132 add_image_size( 'small-feature', 500, 300 ); // Used for featured posts if a large-feature doesn't exist 133 133 134 134 // Add a way for the custom header to be styled in the admin panel that controls -
trunk/wp-content/themes/twentyeleven/showcase.php
r17717 r17761 4 4 * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts 5 5 * 6 * The showcase template in Twenty Eleven consists of a featured posts section using sticky posts, 7 * another recent posts area (with the latest post shown in full and the rest as a list) 8 * and a left sidebar holding aside posts. 9 * 10 * We are creating two queries to fetch the proper posts and a custom widget for the sidebar. 11 * 6 12 * @package WordPress 7 13 * @subpackage Twenty Eleven 8 14 */ 9 15 16 // Enqueue showcase script for the slider 17 wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '2011-04-28' ); 18 10 19 get_header(); ?> 11 20 … … 16 25 17 26 <?php 18 // If we have content for this page, let's display it. 27 /** 28 * We are using a heading by rendering the_content 29 * If we have content for this page, let's display it. 30 */ 19 31 if ( '' != get_the_content() ) 20 32 get_template_part( 'content', 'intro' ); … … 22 34 23 35 <?php 24 // See if we have any sticky posts and use the latest to create a featured post 36 /** 37 * Begin the featured posts section. 38 * 39 * See if we have any sticky posts and use them to create our featured posts. 40 */ 25 41 $sticky = get_option( 'sticky_posts' ); 26 42 $featured_args = array( 27 'posts_per_page' => 1,43 'posts_per_page' => 4, 28 44 'post__in' => $sticky, 29 45 ); 30 46 47 // The Featured Posts query. 31 48 $featured = new WP_Query(); 32 49 $featured->query( $featured_args ); 33 50 51 /** 52 * We will need to count featured posts starting from zero 53 * to create the slider navigation. 54 */ 55 $counter_slider = 0; 56 57 ?> 58 59 <div class="featured-posts"> 60 <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1> 61 62 <?php 34 63 // Let's roll. 35 if ( $sticky ) : 36 37 $featured->the_post(); 38 39 // We're going to add a class to our featured post for featured images 40 // by default it'll have no class though 64 while ( $featured->have_posts() ) : $featured->the_post(); 65 66 // Increase the counter. 67 $counter_slider++; 68 69 /** 70 * We're going to add a class to our featured post for featured images 71 * by default it'll have no class though. 72 */ 41 73 $feature_class = ''; 42 74 43 75 if ( has_post_thumbnail() ) { 44 // …but if it has a featured image let's add some class76 // ... but if it has a featured image let's add some class 45 77 $feature_class = 'feature-image small'; 46 78 … … 50 82 // Is it bigger than or equal to our header? 51 83 if ( $image[1] >= HEADER_IMAGE_WIDTH ) { 52 // Let's add a BIGGER class. It's EXTRA classy now.84 // If bigger, let's add a BIGGER class. It's EXTRA classy now. 53 85 $feature_class = 'feature-image large'; 54 86 } 55 87 } 56 ?>88 ?> 57 89 58 90 <?php if ( has_post_thumbnail() ) : ?> 59 <section class="featured-post <?php echo $feature_class; ?>" >91 <section class="featured-post <?php echo $feature_class; ?>" id="featured-post-<?php echo $counter_slider; ?>"> 60 92 <?php else : ?> 61 <section class="featured-post" >93 <section class="featured-post" id="featured-post-<?php echo $counter_slider; ?>"> 62 94 <?php endif; ?> 63 <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1> 95 64 96 <?php 65 // Dynamic thumbnails! 97 /** 98 * If the thumbnail is as big as the header image 99 * make it a large featured post, otherwise render it small 100 */ 66 101 if ( has_post_thumbnail() ) { 67 102 if ( $image[1] >= HEADER_IMAGE_WIDTH ) { ?> … … 74 109 <?php get_template_part( 'content', 'featured' ); ?> 75 110 </section> 76 <?php endif; ?> 111 <?php endwhile; ?> 112 113 <nav class="feature-slider"> 114 <ul> 115 <?php 116 /** 117 * We need to query the same set of posts again 118 * to populate the navigation dots 119 */ 120 $featured->query( $featured_args ); 121 122 // Reset the counter so that we end up with matching elements 123 $counter_slider = 0; 124 125 // Begin from zero 126 rewind_posts(); 127 128 // Let's roll again. 129 while ( $featured->have_posts() ) : $featured->the_post(); 130 $counter_slider++; 131 ?> 132 <li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php printf( esc_attr__( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" <?php 133 if ( 1 == $counter_slider ) : 134 echo 'class="active"'; 135 endif; 136 ?>></a></li> 137 <?php endwhile; ?> 138 </ul> 139 </nav> 140 </div> 77 141 78 142 <section class="recent-posts"> … … 81 145 <?php 82 146 83 // Display our recent posts, showing full content for the very latest, ignoring Aside posts 147 // Display our recent posts, showing full content for the very latest, ignoring Aside posts. 84 148 $recent_args = array( 85 149 'order' => 'DESC', … … 94 158 ), 95 159 ); 160 // Our new query for the Recent Posts section. 96 161 $recent = new WP_Query(); 97 162 $recent->query( $recent_args ); … … 99 164 100 165 while ( $recent->have_posts() ) : $recent->the_post(); 101 // set $more to 0 in order to only get the first part of the post166 // Set $more to 0 in order to only get the first part of the post. 102 167 global $more; 103 168 $more = 0; -
trunk/wp-content/themes/twentyeleven/style.css
r17756 r17761 604 604 z-index: 1; 605 605 } 606 #branding .with-image #searchform {607 bottom: -27px;608 top: auto;609 }610 606 #branding .only-search #s { 611 607 background-color: #666; … … 615 611 #branding .only-search #s:focus { 616 612 background-color: #bbb; 613 } 614 #branding .with-image #searchform { 615 bottom: -27px; 616 top: auto; 617 617 } 618 618 … … 680 680 font-weight: bold; 681 681 } 682 .entry-meta a:focus,683 .entry-meta a:active,684 .entry-meta a:hover {685 }686 682 .entry-content, 687 683 .entry-summary { … … 702 698 line-height: 2.6em; 703 699 text-transform: uppercase; 704 }705 .entry-content a {706 }707 .entry-content a:hover {708 700 } 709 701 .entry-content table, … … 768 760 .entry-meta .edit-link a { 769 761 background: #aaa; 770 color: #fff;771 762 -moz-border-radius: 3px; 772 763 border-radius: 3px; 764 color: #fff; 773 765 float: right; 774 766 font-size: 12px; … … 810 802 -moz-border-radius: 3px; 811 803 border-radius: 3px; 812 padding: 3px;813 804 -webkit-box-shadow: 0 1px 2px #bbb; 814 805 -moz-box-shadow: 0 1px 2px #bbb; 815 806 box-shadow: 0 1px 2px #bbb; 807 padding: 3px; 816 808 } 817 809 #author-description { … … 834 826 color: #777; 835 827 font-size: 18px; 828 font-weight: 300; 836 829 height: 48px; 830 line-height: 46px; 837 831 overflow: hidden; 838 832 position: absolute; 833 text-align: center; 834 text-decoration: none; 839 835 top: 0; 840 836 right: 0; 841 text-align: center;842 text-decoration: none;843 837 width: 48px; 844 font-weight: 300;845 line-height: 46px;846 838 } 847 839 .entry-header .comments-link a:hover { 848 840 background: #777; 841 border-color: #555; 849 842 color: #fff; 850 border-color: #555;851 843 } 852 844 .entry-header .comments-link .leave-reply { … … 876 868 padding-right: 0; 877 869 } 878 879 870 .singular .entry-header .entry-meta { 880 871 position: absolute; … … 882 873 left: 0; 883 874 } 884 .singular .entry-header a {885 }886 .singular .entry-header a:hover {887 }888 .singular footer.entry-meta {889 }890 875 .singular blockquote.pull { 891 876 font-size: 21px; … … 905 890 } 906 891 .singular .entry-meta .edit-link a { 892 bottom: auto; 907 893 color: #fff; 894 left: 50px; 908 895 position: absolute; 909 bottom: auto;910 left: 50px;911 896 right: auto; 912 897 top: 80px; … … 1005 990 border-width: 1px 0; 1006 991 margin: 0 -8.9% 1.625em; 992 overflow: hidden; 1007 993 padding: 1.625em 8.9%; 1008 overflow: hidden;1009 994 } 1010 995 .error404 #main #s { … … 1062 1047 position: absolute; 1063 1048 background: #aaa; 1064 color: #fff;1065 1049 -moz-border-radius: 3px; 1066 1050 border-radius: 3px; 1051 color: #fff; 1067 1052 padding: 0px 8px; 1068 1053 font-size: 12px; … … 1077 1062 /* Featured post */ 1078 1063 section.featured-post { 1079 border-bottom: 1px solid #e8e8e8;1080 1064 float: left; 1081 1065 margin: -1.625em -8.9% 1.625em; … … 1087 1071 border: none; 1088 1072 color: #666; 1089 font-size: 13px;1090 1073 margin: 0; 1091 1074 } … … 1104 1087 max-width: 59%; 1105 1088 position: relative; 1106 right: - 20px;1089 right: -35px; 1107 1090 } 1108 1091 section.featured-post .attachment-small-feature:hover { … … 1114 1097 width: 45%; 1115 1098 } 1099 article.feature-image.small .entry-summary { 1100 color: #555; 1101 font-size: 13px; 1102 } 1116 1103 article.feature-image.small .entry-summary p a { 1117 1104 background: #222; 1118 1105 color: #eee; 1119 1106 display: block; 1120 left: - 19.8%;1121 padding: 4px 26px 4px 75px;1107 left: -23.8%; 1108 padding: 4px 26px 4px 85px; 1122 1109 position: relative; 1123 1110 text-decoration: none; 1124 1111 top: 20px; 1125 width: 1 20px;1112 width: 180px; 1126 1113 } 1127 1114 article.feature-image.small .entry-summary p a:hover { … … 1142 1129 section.feature-image.large .hentry { 1143 1130 border-bottom: none; 1131 left: 9%; 1144 1132 margin: 1.625em 9% 0 0; 1145 1133 position: absolute; 1146 1134 top: 0; 1147 left: 9%;1148 1135 } 1149 1136 article.feature-image.large .entry-title a { … … 1153 1140 border-radius: 3px; 1154 1141 color: #fff; 1142 display: inline-block; 1155 1143 font-weight: 300; 1156 display: inline-block;1157 1144 padding: .2em 20px; 1158 1145 } 1159 1146 section.feature-image.large:hover .entry-title a, 1160 1147 section.feature-image.large .entry-title:hover a { 1161 background: # 1b8be0;1162 background: rgba( 0,145,255,0.8);1163 color: # bfddF3;1148 background: #eee; 1149 background: rgba(255,255,255,0.8); 1150 color: #222; 1164 1151 } 1165 1152 article.feature-image.large .entry-summary { … … 1170 1157 display: block; 1171 1158 height: auto; 1159 max-width: 117.9%; 1172 1160 padding: 0 0 6px; 1173 max-width: 117.9%; 1161 } 1162 1163 /* Featured Slider */ 1164 .featured-posts { 1165 border-bottom: 1px solid #e8e8e8; 1166 display: block; 1167 height: 340px; 1168 margin: 1.625em -8.9% 20px; 1169 max-width: 1000px; 1170 padding: 0; 1171 position: relative; 1172 } 1173 .featured-posts .showcase-heading { 1174 padding-left: 8.9%; 1175 } 1176 .featured-posts section.featured-post { 1177 background: #fff; 1178 height: 300px; 1179 left: 0; 1180 margin: 0; 1181 position: absolute; 1182 top: 30px; 1183 width: auto; 1184 } 1185 .featured-posts section.featured-post.large { 1186 overflow: hidden; 1187 } 1188 .featured-posts section.featured-post { 1189 -webkit-transition-duration: 200ms; 1190 -webkit-transition-property: opacity visibility; 1191 -webkit-transition-timing-function: ease; 1192 -moz-transition-duration: 200ms; 1193 -moz-transition-property: opacity visibility; 1194 -moz-transition-timing-function: ease; 1195 } 1196 .featured-posts section.featured-post { 1197 opacity: 0; 1198 visibility: hidden; 1199 } 1200 .featured-posts #featured-post-1 { 1201 opacity: 1; 1202 visibility: visible; 1203 } 1204 #content .feature-slider { 1205 bottom: 0; 1206 left: 8.9%; 1207 overflow: visible; 1208 position: absolute; 1209 } 1210 .feature-slider ul { 1211 list-style-type: none; 1212 margin: 0; 1213 } 1214 .feature-slider li { 1215 float: left; 1216 margin: 0 6px; 1217 } 1218 .feature-slider a { 1219 background: #3c3c3c; 1220 background: rgba(60,60,60,0.9); 1221 -moz-border-radius: 12px; 1222 border-radius: 12px; 1223 -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); 1224 -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); 1225 box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5); 1226 display: block; 1227 height: 14px; 1228 width: 14px; 1229 } 1230 .feature-slider a.active { 1231 background: #fff; 1232 background: rgba(255,255,255,0.8); 1233 -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); 1234 -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); 1235 box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8); 1174 1236 } 1175 1237 … … 1210 1272 section.recent-posts .other-recent-posts .comments-link > span { 1211 1273 border-bottom: 2px solid #999; 1212 display: block;1274 bottom: -2px; 1213 1275 color: #444; 1214 text-align: right;1276 display: block; 1215 1277 font-size: 10px; 1216 1278 font-weight: 500; … … 1218 1280 padding: 0.3125em 0 0.3125em 1em; 1219 1281 position: absolute; 1220 bottom: -2px;1221 1282 right: 0; 1283 text-align: right; 1222 1284 text-transform: uppercase; 1223 1285 z-index: 1; … … 1248 1310 border-width: 1px 0; 1249 1311 margin: 0 -8.9% 1.625em; 1312 overflow: hidden; 1250 1313 padding: 1.625em 1.625em 0; 1251 1314 text-align: center; 1252 overflow: hidden;1253 1315 } 1254 1316 .image-attachment div.attachment img { … … 1273 1335 img.size-medium, 1274 1336 img.size-thumbnail { 1337 height: auto; 1275 1338 max-width: 100%; 1276 height: auto;1277 1339 } 1278 1340 img.wp-smiley { … … 1286 1348 .wp-caption { 1287 1349 background: #f4f2ed; 1350 margin-bottom: 1.625em; 1288 1351 max-width: 96%; 1289 margin-bottom: 1.625em;1290 1352 padding: 12px; 1291 1353 } … … 1331 1393 line-height: 2.2em; 1332 1394 } 1333 #content nav a:focus,1334 #content nav a:active,1335 #content nav a:hover {1336 }1337 1395 #nav-above { 1338 1396 padding: 0 0 1.625em; … … 1355 1413 top: -4px; 1356 1414 right: 0; 1357 z-index: 1000;1358 1415 } 1359 1416 #nav-single .nav-previous, … … 1370 1427 ----------------------------------------------- */ 1371 1428 1372 #secondary {1373 }1374 1429 .widget-area { 1375 1430 font-size: 12px; … … 1413 1468 } 1414 1469 .widget_search #searchsubmit { 1415 -webkit-box-shadow: rgba(0, 0, 0, 0.09) 0px -1px 1px inset; 1416 background: #DDD; 1417 border: 1px solid #CCC; 1470 background: #ddd; 1471 border: 1px solid #ccc; 1472 -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); 1473 -moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); 1474 box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); 1418 1475 color: #888; 1419 1476 font-size: 13px; … … 1424 1481 .widget_search #searchsubmit:active { 1425 1482 background: #1b8be0; 1426 color: #BFDDF3; 1427 border-color: #0861A5; 1428 -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 1px inset; 1483 border-color: #0861a5; 1484 -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); 1485 -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); 1486 box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); 1487 color: #bfddf3; 1429 1488 } 1430 1489 … … 1579 1638 -moz-border-radius: 3px; 1580 1639 border-radius: 3px; 1640 -webkit-box-shadow: 0 1px 2px #ccc; 1641 -moz-box-shadow: 0 1px 2px #ccc; 1642 box-shadow: 0 1px 2px #ccc; 1643 left: -102px; 1581 1644 padding: 0; 1582 1645 position: absolute; 1583 1646 top: 0; 1584 left: -102px;1585 -webkit-box-shadow: 0 1px 2px #ccc;1586 -moz-box-shadow: 0 1px 2px #ccc;1587 box-shadow: 0 1px 2px #ccc;1588 1647 } 1589 1648 .commentlist > li:before { 1590 1649 content: url(images/comment-arrow.png) no-repeat; 1650 left: -21px; 1591 1651 position: absolute; 1592 left: -21px;1593 1652 } 1594 1653 .commentlist > li.pingback:before { … … 1597 1656 .commentlist .children .avatar { 1598 1657 background: none; 1599 padding: 0;1600 top: 2.2em;1601 left: 2.2em;1602 1658 -webkit-box-shadow: none; 1603 1659 -moz-box-shadow: none; 1604 1660 box-shadow: none; 1605 } 1606 .commentlist .children .bypostauthor > article .comment-meta .vcard .avatar { 1661 left: 2.2em; 1662 padding: 0; 1663 top: 2.2em; 1607 1664 } 1608 1665 a.comment-reply-link { 1609 1666 font-size: 12px; 1610 1667 font-weight: bold; 1611 }1612 .comment-reply-link:hover,1613 .comment-reply-link:active,1614 .comment-reply-link:focus {1615 1668 } 1616 1669 … … 1697 1750 position: relative; 1698 1751 width: 68.9%; 1699 }1700 #respond a {1701 }1702 #respond a:focus,1703 #respond a:active,1704 #respond a:hover {1705 1752 } 1706 1753 #respond input[type="text"], … … 1734 1781 display: inline-block; 1735 1782 font-size: 13px; 1783 left: 4px; 1784 min-width: 60px; 1736 1785 padding: 4px 10px; 1737 1786 position: relative; 1738 1787 top: 41px; 1739 left: 4px;1740 min-width: 60px;1741 1788 z-index: 1; 1742 /*text-shadow: 1px 1px 1px #fff; */1743 1789 } 1744 1790 #respond input[type="text"]:focus, … … 1755 1801 font-size: 22px; 1756 1802 font-weight: bold; 1803 left: 68%; 1757 1804 position: absolute; 1758 1805 top: 52px; 1759 left: 68%;1760 1806 z-index: 1; 1761 1807 } … … 1763 1809 #respond .logged-in-as { 1764 1810 font-size: 13px; 1765 }1766 #respond .logged-in-as a {1767 1811 } 1768 1812 #respond p { … … 1784 1828 cursor: pointer; 1785 1829 font-size: 15px; 1830 left: 30px; 1786 1831 margin: 20px 0; 1787 1832 padding: 5px 42px 5px 22px; 1833 position: relative; 1788 1834 text-shadow: 0 -1px 0 rgba(0,0,0,0.3); 1789 position: relative;1790 left: 30px;1791 1835 } 1792 1836 #respond input#submit:active { … … 1821 1865 letter-spacing: 0.05em; 1822 1866 position: absolute; 1823 top: 1.1em;1824 1867 right: 1.625em; 1825 1868 text-decoration: none; 1826 1869 text-transform: uppercase; 1870 top: 1.1em; 1827 1871 } 1828 1872 #cancel-comment-reply-link:focus, … … 1894 1938 font-weight: bold; 1895 1939 } 1896 #site-generator a:focus,1897 #site-generator a:active,1898 #site-generator a:hover {1899 }1900 1940 1901 1941 … … 1937 1977 display: block; 1938 1978 float: none; 1979 height: auto; 1939 1980 margin: 0.625em auto 1.025em; 1940 1981 max-width: 100%; 1941 height: auto;1942 1982 position: static; 1943 1983 } … … 1968 2008 } 1969 2009 .singular .entry-meta .edit-link a { 2010 left: 0px; 1970 2011 position: absolute; 1971 left: 0px;1972 2012 top: 40px; 1973 2013 } … … 2025 2065 } 2026 2066 .commentlist .children .avatar { 2067 background: none; 2068 left: 2.2em; 2069 padding: 0; 2027 2070 position: absolute; 2028 background: none;2029 padding: 0;2030 2071 top: 2.2em; 2031 left: 2.2em;2032 2072 } 2033 2073 } … … 2057 2097 display: block !important; 2058 2098 float: none !important; 2099 max-width: 100%; 2059 2100 position: relative !important; 2060 max-width: 100%;2061 2101 } 2062 2102 #branding { … … 2109 2149 .singular footer.entry-meta, 2110 2150 .singular #comments-title { 2151 margin: 0; 2111 2152 width: 100%; 2112 margin: 0;2113 2153 } 2114 2154 .singular .hentry { … … 2148 2188 .commentlist > li.comment { 2149 2189 background: none; 2150 border: 1px solid #DDDDDD; 2190 border: 1px solid #ddd; 2191 -moz-border-radius: 3px 3px 3px 3px; 2151 2192 border-radius: 3px 3px 3px 3px; 2152 2193 margin: 0 auto 1.625em; … … 2156 2197 } 2157 2198 .commentlist .avatar { 2158 width: 39px;2159 2199 height: 39px; 2160 2200 left: 2.2em; 2161 2201 top: 2.2em; 2202 width: 39px; 2162 2203 } 2163 2204 .commentlist li.comment .comment-meta {
Note: See TracChangeset
for help on using the changeset viewer.