Ticket #23620: 23620.2.diff
| File 23620.2.diff, 2.5 KB (added by , 13 years ago) |
|---|
-
wp-content/themes/twentythirteen/functions.php
436 436 return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); 437 437 } 438 438 439 /** 440 * Finds first video from a given post. 441 * 442 * 1. Tries for a video source element in post content. 443 * 2. Tries for a video embed in post content. 444 * 3. Tries for an attached video. 445 * 446 * @param object $post 447 * @return array First node in just video URL, second node is the rest of the content. 448 */ 449 function twentythirteen_get_video_content() { 450 $post_content = get_the_content(); 451 452 $content_video = get_content_video( $post_content, true ); 453 454 if ( empty( $content_video ) ) { 455 $content_video = get_embedded_video( $post_content, true ); 456 457 if ( empty( $content_video ) ) 458 $content_video = get_attached_video( get_the_ID() ); 459 } 460 461 return array( 462 $content_video[0], 463 $post_content 464 ); 465 } 466 439 467 if ( ! function_exists( 'twentythirteen_featured_gallery' ) ) : 440 468 /** 441 469 * Displays first gallery from post content. Changes image size from thumbnail … … 574 602 /** 575 603 * Adds support for a custom header image. 576 604 */ 577 require( get_template_directory() . '/inc/custom-header.php' ); 605 require( get_template_directory() . '/inc/custom-header.php' ); 606 No newline at end of file -
wp-content/themes/twentythirteen/content-video.php
10 10 11 11 <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> 12 12 <header class="entry-header"> 13 <?php 14 $content_pieces = twentythirteen_get_video_content(); 15 echo $content_pieces[0]; 16 ?> 17 13 18 <?php if ( is_single() ) : ?> 14 19 <h1 class="entry-title"><?php the_title(); ?></h1> 15 20 <?php else : ?> … … 20 25 </header><!-- .entry-header --> 21 26 22 27 <div class="entry-content"> 23 <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentythirteen' ) ); ?>28 <?php echo $content_pieces[1]; ?> 24 29 <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> 25 30 </div><!-- .entry-content --> 26 31