Changeset 6142 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/front-page.php
- Timestamp:
- 11/17/2017 01:31:00 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/front-page.php
r6137 r6142 14 14 15 15 namespace WordPressdotorg\MainTheme; 16 17 global $rosetta; 18 19 $showcase = $rosetta->showcase->front(); 20 $swag_class = $showcase ? 'col-4' : 'col-2'; 21 $user_class = $showcase ? 'col-12' : 'col-2'; 16 22 17 23 get_header( 'wporg' ); … … 135 141 </div> 136 142 137 <div class=" col-2first">143 <div class="<?php echo esc_attr( $swag_class ); ?> first"> 138 144 <h4><a href="https://wordpress.org/about/swag/"><?php _e( 'WordPress Swag', 'wporg' ); ?></a></h4> 139 <a href="https://wordpress.org/about/swag/"><img width="132" height="177" src="https://wpdotorg.files.wordpress.com/2015/10/gray-tshirt-swag.jpg" alt="<?php esc_attr_e( 'WordPress Swag', 'wporg' ); ?>" /></a> 140 </div> 141 142 <div class="col-2"> 145 <a href="https://wordpress.org/about/swag/"> 146 <?php if ( $showcase ) : ?> 147 <img width="288" height="288" src="https://s.w.org/images/home/swag_col-2.png" srcset="https://s.w.org/images/home/swag_col-2_x2.jpg x2" alt="<?php esc_attr_e( 'WordPress Swag', 'wporg' ); ?>" /> 148 <?php else : ?> 149 <img width="132" height="177" src="https://s.w.org/images/home/swag_col-1.jpg?1" alt="<?php esc_attr_e( 'WordPress Swag', 'wporg' ); ?>" /> 150 <?php endif; ?> 151 </a> 152 </div> 153 154 <div class="<?php echo esc_attr( $user_class ); ?>"> 143 155 <h4><a href="https://wordpress.org/showcase/"><?php _e( 'WordPress Users', 'wporg' ); ?></a></h4> 144 156 145 <ul id="notable-users" class="notable-users"> 146 <?php 147 $links = array( 157 <?php if ( $showcase ) : ?> 158 <div id="notable-users" class="notable-users col-12 row gutters"> 159 <?php 160 foreach ( $showcase as $showcase_post ) : 161 $post_url = get_permalink( $showcase_post->ID ); 162 $thumbnail = has_post_thumbnail( $showcase_post->ID ) 163 ? get_the_post_thumbnail( $showcase_post->ID, 'showcase-thumbnail' ) 164 : sprintf( '<img src="%1$s" width="220" alt="%2$s" />', esc_url( $rosetta->screenshot_url( $post_url, 220 ) ), esc_attr( $showcase_post->post_title ) ); 165 166 printf( 167 '<div class="col-3"><a href="%1$s">%2$s</a></div>', 168 esc_url( $post_url ), 169 $thumbnail 170 ); 171 endforeach; 172 ?> 173 </div> 174 <?php else : ?> 175 <ul id="notable-users" class="notable-users"> 176 <?php 177 $user_links = [ 148 178 'nytimes' => 'https://wordpress.org/showcase/tag/new-york-times/', 149 179 'cnn' => 'https://wordpress.org/showcase/tag/cnn/', … … 154 184 'blondie' => 'https://wordpress.org/showcase/blondie/', 155 185 'marthastewart' => 'https://wordpress.org/showcase/themarthablog/', 156 );157 158 foreach ( array_rand( $ links, 3 ) as $slug ) :186 ]; 187 188 foreach ( array_rand( $user_links, 3 ) as $slug ) : 159 189 printf( 160 190 '<li><a href="%1$s"><img src="https://s.w.org/images/notableusers/%2$s-2x.png" alt="%2$s" width="130" height="57" /></a></li>', 161 $ links[ $slug ],191 $user_links[ $slug ], 162 192 $slug 163 193 ); 164 194 endforeach; 165 ?> 166 </ul> 195 ?> 196 </ul> 197 <?php endif; ?> 198 167 199 <a class="showcase-link" href="https://wordpress.org/showcase/"><?php _e( '… and hundreds more', 'wporg' ); ?></a> 168 200 </div> … … 171 203 </main><!-- #main --> 172 204 173 <?php205 <?php 174 206 get_footer();
Note: See TracChangeset
for help on using the changeset viewer.