content-video.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /**
  3. * @package Illustratr
  4. */
  5. // Access global variable directly to adjust the content width for video post format
  6. if ( isset( $GLOBALS['content_width'] ) ) {
  7. $GLOBALS['content_width'] = 1100;
  8. }
  9. $content = apply_filters( 'the_content', get_the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'illustratr' ) ) );
  10. $media = get_media_embedded_in_content( $content, array( 'video', 'object', 'embed', 'iframe' ) );
  11. if ( ! empty( $media ) ) {
  12. foreach( $media as $embed_html ) {
  13. $content = str_replace( $embed_html, '', $content );
  14. }
  15. }
  16. ?>
  17. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  18. <?php if ( ! empty( $media ) ) : ?>
  19. <div class="entry-media">
  20. <?php
  21. foreach ( $media as $embed_html ) {
  22. printf( '%s', $embed_html );
  23. }
  24. ?>
  25. </div><!-- .entry-media -->
  26. <?php endif; ?>
  27. <header class="entry-header">
  28. <?php
  29. if ( is_single() ) {
  30. the_title( '<h1 class="entry-title">', '</h1>' );
  31. } else {
  32. the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
  33. }
  34. ?>
  35. <?php
  36. /* translators: used between list items, there is a space after the comma */
  37. $categories_list = get_the_category_list( __( ', ', 'illustratr' ) );
  38. if ( 'post' == get_post_type() && $categories_list && illustratr_categorized_blog() ) :
  39. ?>
  40. <span class="cat-links"><?php echo $categories_list; ?></span>
  41. <?php endif; ?>
  42. </header><!-- .entry-header -->
  43. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  44. <div class="entry-summary">
  45. <?php the_excerpt(); ?>
  46. </div><!-- .entry-summary -->
  47. <?php else : ?>
  48. <div class="entry-content">
  49. <?php echo $content; ?>
  50. <?php
  51. wp_link_pages( array(
  52. 'before' => '<div class="page-links clear">',
  53. 'after' => '</div>',
  54. 'pagelink' => '<span class="page-link">%</span>',
  55. ) );
  56. ?>
  57. </div><!-- .entry-content -->
  58. <?php endif; ?>
  59. <footer class="entry-meta">
  60. <?php illustratr_posted_on(); ?>
  61. <span class="entry-format"><a href="<?php echo esc_url( get_post_format_link( 'video' ) ); ?>" title="<?php echo esc_attr( sprintf( __( 'All %s posts', 'illustratr' ), get_post_format_string( 'video' ) ) ); ?>"><?php echo get_post_format_string( 'video' ); ?></a></span>
  62. <?php
  63. /* translators: used between list items, there is a space after the comma */
  64. the_tags( sprintf( '<span class="tags-links">%s ', esc_html__( 'Tagged', 'illustratr' ) ), esc_html__( ', ', 'illustratr' ), '</span>' ); ?>
  65. <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
  66. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'illustratr' ), __( '1 Comment', 'illustratr' ), __( '% Comments', 'illustratr' ) ); ?></span>
  67. <?php endif; ?>
  68. <?php edit_post_link( __( 'Edit', 'illustratr' ), '<span class="edit-link">', '</span>' ); ?>
  69. </footer><!-- .entry-meta -->
  70. </article><!-- #post-## -->