Changeset 1705
- Timestamp:
- 07/05/2015 07:26:25 PM (10 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/archive.php
r1474 r1705 18 18 19 19 <div class="story-excerpt"> 20 <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><img src="<?php site_screenshot_src(145); ?>" class="alignleft" width="145" height="110" alt="<?php the_title_attribute(); ?>" /></a> 21 20 <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"> 21 <?php site_screenshot_tag( 145, 'screenshot alignleft' ); ?> 22 </a> 22 23 <h5><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5> 23 24 <div class="excerpt"><?php the_content_limit(200); ?></div> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/functions.php
r1474 r1705 31 31 } 32 32 33 if ( !empty( $_COOKIE['devicePixelRatio'] ) && $_COOKIE['devicePixelRatio'] >= 1.5 ) {34 $width = $width * 2;35 }36 37 33 if ( '' != $width ) { 38 34 $screenshot .= '?w=' . $width; … … 46 42 return $screenshot; 47 43 } 44 } 45 46 // build the whole img tag properly for the screenshot, with srcset support 47 function site_screenshot_tag( $width = '', $classes='screenshot' ) { 48 global $post; 49 50 $screenshot = get_post_meta($post->ID, 'screenshot', true); 51 if ( empty( $screenshot ) ) { 52 $screenshot = 'https://wordpress.com/mshots/v1/http%3A%2F%2F' . get_site_domain( true, false ); 53 $srcset = $screenshot; 54 } 55 56 if ( '' != $width ) { 57 $screenshot .= '?w=' . $width; 58 $srcset .= '?w=' . $width*2; 59 } 60 61 // mshot images have a 4/3 ratio 62 $height = (int)( $width * (3/4) ); 63 64 $img = "<img src='{$screenshot}' srcset='$srcset 2x' width='{$width}' height='{$height}' alt='". the_title_attribute(array('echo'=>false)) . "' class='{$classes}' />"; 65 66 echo $img; 48 67 } 49 68 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/page-home.php
r1474 r1705 18 18 <div class="wpsc-hero-slide-content"> 19 19 <a href="<?php the_permalink(); ?>" class="wpsc-hero-slide-img"> 20 < img src="<?php site_screenshot_src( 487 ); ?>" alt="<?php the_title_attribute(); ?>" width="487" height="365" />20 <?php site_screenshot_tag( 457 ); ?> 21 21 </a> 22 22 <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> … … 63 63 <li> 64 64 <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"> 65 < img src="<?php site_screenshot_src( 215 ); ?>" width="215" height="161" alt="<?php the_title_attribute(); ?>" class="screenshot" />65 <?php site_screenshot_tag( 215 ); ?> 66 66 </a> 67 67 <h5><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5> … … 86 86 <li> 87 87 <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"> 88 < img src="<?php site_screenshot_src( 215 ); ?>" width="215" height="155" alt="<?php the_title_attribute(); ?>" class="screenshot" />88 <?php site_screenshot_tag( 215 ); ?> 89 89 </a> 90 90 <h5><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h5> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-showcase/single.php
r1474 r1705 12 12 <?php breadcrumb(); ?> 13 13 <a href=' http://<?php get_site_domain( false ); ?>'> 14 < img src="<?php site_screenshot_src( 340 ); ?>" class='site-screenshot' title='<?php the_title(); ?>' width='340' height='255' />14 <?php site_screenshot_tag( 340, 'screenshot site-screenshot'); ?> 15 15 </a> 16 16 <?php the_content(); ?>
Note: See TracChangeset
for help on using the changeset viewer.