Changeset 27622
- Timestamp:
- 03/19/2014 06:59:31 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyeleven/style.css
r27570 r27622 1707 1707 } 1708 1708 1709 /* =Media 1710 -------------------------------------------------------------- */ 1711 1712 audio, 1713 video { 1714 display: inline-block; 1715 max-width: 100%; 1716 } 1717 1718 .attachment .entry-content .mejs-container { 1719 margin-bottom: 24px; 1720 } 1709 1721 1710 1722 /* =Navigation -
trunk/src/wp-content/themes/twentythirteen/style.css
r27607 r27622 1838 1838 } 1839 1839 1840 .attachment .entry-content .mejs-audio { 1841 max-width: 400px; 1842 margin: 0 auto; 1843 } 1844 1845 .attachment .entry-content .wp-video { 1846 margin: 0 auto; 1847 } 1848 1849 .attachment .entry-content .mejs-container { 1850 margin-bottom: 24px; 1851 } 1840 1852 1841 1853 /** -
trunk/src/wp-content/themes/twentytwelve/style.css
r27606 r27622 1008 1008 } 1009 1009 1010 /* =Single audio/video attachment view 1011 -------------------------------------------------------------- */ 1012 1013 .attachment .entry-content .mejs-audio { 1014 max-width: 400px; 1015 } 1016 1017 .attachment .entry-content .mejs-container { 1018 margin-bottom: 24px; 1019 } 1020 1010 1021 1011 1022 /* =Single image attachment view -
trunk/src/wp-includes/post-template.php
r27473 r27622 348 348 $classes[] = 'post-password-required'; 349 349 // Post thumbnails 350 } elseif ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {350 } elseif ( ! is_attachment( $post ) && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) { 351 351 $classes[] = 'has-post-thumbnail'; 352 352 } … … 1242 1242 return $content; 1243 1243 1244 $p = '<p class="attachment">'; 1245 // show the medium sized image representation of the attachment if available, and link to the raw file 1246 $p .= wp_get_attachment_link(0, 'medium', false); 1247 $p .= '</p>'; 1244 if ( wp_attachment_is_image() ): 1245 $p = '<p class="attachment">'; 1246 // show the medium sized image representation of the attachment if available, and link to the raw file 1247 $p .= wp_get_attachment_link(0, 'medium', false); 1248 $p .= '</p>'; 1249 elseif ( 0 === strpos( $post->post_mime_type, 'video' ) ): 1250 $meta = wp_get_attachment_metadata( get_the_ID() ); 1251 $atts = array( 'src' => wp_get_attachment_url() ); 1252 if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) { 1253 $atts['width'] = (int) $meta['width']; 1254 $atts['height'] = (int) $meta['height']; 1255 } 1256 $p = wp_video_shortcode( $atts ); 1257 elseif ( 0 === strpos( $post->post_mime_type, 'audio' ) ): 1258 $p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) ); 1259 endif; 1260 1248 1261 $p = apply_filters('prepend_attachment', $p); 1249 1262
Note: See TracChangeset
for help on using the changeset viewer.